Skip to content

Commit

Permalink
red_black_bst: Comparable as protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
holgerdell committed Jan 13, 2020
1 parent 00687f5 commit bb08a21
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion itu/algs4/searching/red_black_bst.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from abc import abstractmethod
from typing import Generic, Optional, TypeVar

from typing_extensions import Protocol

from ..errors.errors import IllegalArgumentException, NoSuchElementException
from ..fundamentals.queue import Queue

Expand All @@ -14,7 +16,7 @@
Key = TypeVar('Key', bound = "Comparable")
Val = TypeVar('Val')

class Comparable():
class Comparable(Protocol):
@abstractmethod
def __lt__(self: Key, other: Key) -> bool:
pass
Expand Down

0 comments on commit bb08a21

Please sign in to comment.