MCPcopy Create free account
hub / github.com/bslatkin/effectivepython / __eq__

Method __eq__

example_code/item_056.py:322–328  ·  view source on GitHub ↗
(self, other)

Source from the content-addressed store, hash-verified

320
321
322 def __eq__(self, other):
323 return (
324 type(self) == type(other)
325 and self.name == other.name
326 and self.x == other.x
327 and self.y == other.y
328 )
329
330
331print("Example 27")

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected