Skip to content

Commit

Permalink
#240 fix for Python <3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
wojtask committed Oct 6, 2024
1 parent 28e2311 commit c742bc3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/book/data_structures.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,19 @@
from typing_extensions import Self


T = TypeVar('T')


class Comparable(Protocol):
def __le__(self, other: Any) -> bool:
pass


class Indexable[T](Protocol):
class Indexable(Protocol[T]):
__getitem__: Callable[[int], T]
__setitem__: Callable[[int, T], None]


T = TypeVar('T')
CT = TypeVar('CT', bound=Comparable)
Bit = Literal[0, 1]

Expand Down

0 comments on commit c742bc3

Please sign in to comment.