diff --git a/data_structures/heap/heap.py b/data_structures/heap/heap.py index 7614e3d7f500..cc1e126ae1e8 100644 --- a/data_structures/heap/heap.py +++ b/data_structures/heap/heap.py @@ -4,6 +4,8 @@ from collections.abc import Iterable from typing import Protocol, TypeVar +T = TypeVar("T") + class Comparable(Protocol): @abstractmethod @@ -11,9 +13,6 @@ def __gt__(self: T, other: T, /) -> bool: pass -T = TypeVar("T", bound=Comparable) - - class Heap[T: Comparable]: """A Max Heap Implementation