Skip to content

Commit

Permalink
Fix 'Item.__eq__' magic method
Browse files Browse the repository at this point in the history
  • Loading branch information
lycantropos committed Apr 5, 2023
1 parent 53db638 commit e292d80
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions prioq/core/item.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,19 @@ class Item(_t.Generic[Key, Value]):
def __init__(self, key: Key, value: Value) -> None:
self.key, self.value = key, value

@_t.overload
def __eq__(self, other: _te.Self) -> bool:
...

@_t.overload
def __eq__(self, other: _t.Any) -> _t.Any:
...

def __eq__(self, other: _t.Any) -> _t.Any:
return (self.key == other.key and self.value == other.value
if isinstance(other, Item)
else NotImplemented)

@_t.overload
def __lt__(self, other: _te.Self) -> bool:
...
Expand Down

0 comments on commit e292d80

Please sign in to comment.