diff --git a/sorts/strand_sort.py b/sorts/strand_sort.py index ee41aa5df51d..e203dd267079 100644 --- a/sorts/strand_sort.py +++ b/sorts/strand_sort.py @@ -1,5 +1,5 @@ import operator -from typing import Protocol, TypeVar +from typing import Protocol class Comparable(Protocol): @@ -8,10 +8,7 @@ def __lt__(self, other: object, /) -> bool: ... def __gt__(self, other: object, /) -> bool: ... -T = TypeVar("T", bound=Comparable) - - -def strand_sort[T]( +def strand_sort[T: Comparable]( arr: list[T], reverse: bool = False, solution: list[T] | None = None ) -> list[T]: """