Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Chapter2/generic_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ def linear_contains(iterable: Iterable[T], key: T) -> bool:


class Comparable(Protocol):
def __eq__(self, other: Any) -> bool:
...
def __eq__(self: C, other: C) -> bool:
return self == other

def __lt__(self: C, other: C) -> bool:
...
return (self < other) and self != other

def __gt__(self: C, other: C) -> bool:
return (not self < other) and self != other
Expand Down