Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions sorts/strand_sort.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import operator
from typing import Protocol, TypeVar
from typing import Protocol


class Comparable(Protocol):
Expand All @@ -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]:
"""
Expand Down
Loading