Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/bslatkin/effectivepython
/ __eq__
Method
__eq__
example_code/item_051.py:432–436 ·
view source on GitHub ↗
(self, other)
Source
from the content-addressed store, hash-verified
430
return
(self.distance, self.size)
431
432
def
__eq__(self, other):
433
return
(
434
type(self) == type(other)
435
and self._astuple() == other._astuple()
436
)
437
438
def
__lt__(self, other):
439
if
type(self) != type(other):
Callers
nothing calls this directly
Calls
2
_astuple
Method · 0.95
_astuple
Method · 0.45
Tested by
no test coverage detected