diff --git a/data_structures/heap/randomized_heap.py b/data_structures/heap/randomized_heap.py index 9668d3ac2a45..5f35fa3c79be 100644 --- a/data_structures/heap/randomized_heap.py +++ b/data_structures/heap/randomized_heap.py @@ -4,9 +4,7 @@ import random from collections.abc import Iterable -from typing import Any, TypeVar - -T = TypeVar("T", bound=bool) +from typing import Any class RandomizedHeapNode[T: bool]: diff --git a/data_structures/heap/skew_heap.py b/data_structures/heap/skew_heap.py index 4e82569444fa..3420ab722d1d 100644 --- a/data_structures/heap/skew_heap.py +++ b/data_structures/heap/skew_heap.py @@ -3,9 +3,7 @@ from __future__ import annotations from collections.abc import Iterable, Iterator -from typing import Any, TypeVar - -T = TypeVar("T", bound=bool) +from typing import Any class SkewNode[T: bool]: