MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / __eq__

Method __eq__

searches/hill_climbing.py:67–73  ·  view source on GitHub ↗

Check if the 2 objects are equal.

(self, obj)

Source from the content-addressed store, hash-verified

65 return hash(str(self))
66
67 def __eq__(self, obj):
68 """
69 Check if the 2 objects are equal.
70 """
71 if isinstance(obj, SearchProblem):
72 return hash(str(self)) == hash(str(obj))
73 return False
74
75 def __str__(self):
76 """

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected