Skip to content

Commit 9005d9b

Browse files
committed
fix: use PEP 695 type params, remove TypeVar import
1 parent f1cbfd7 commit 9005d9b

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

sorts/shell_sort.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,14 @@
22
https://en.wikipedia.org/wiki/Shellsort#Pseudocode
33
"""
44

5-
from typing import Any, Protocol, TypeVar
5+
from typing import Any, Protocol
66

77

88
class Comparable(Protocol):
99
def __lt__(self, other: Any, /) -> bool: ...
1010

1111

12-
T = TypeVar("T", bound=Comparable)
13-
14-
15-
def shell_sort(collection: list[T]) -> list[T]:
12+
def shell_sort[T: Comparable](collection: list[T]) -> list[T]:
1613
"""Pure implementation of shell sort algorithm in Python.
1714
1815
:param collection: Some mutable ordered collection with heterogeneous

0 commit comments

Comments
 (0)