Skip to content

Commit 50dff2c

Browse files
Remove unused TypeVar from bubble sort (#15491)
The PEP 695 type parameters already bound T to Comparable, so the module-level TypeVar was unused. Matches the cleanup requested in #15234.
1 parent 51c2f53 commit 50dff2c

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

‎sorts/bubble_sort.py‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
1-
from typing import Any, Protocol, TypeVar
1+
from typing import Any, Protocol
22

33

44
class Comparable(Protocol):
55
def __lt__(self, other: Any, /) -> bool: ...
66

77

8-
T = TypeVar("T", bound=Comparable)
9-
10-
118
def bubble_sort_iterative[T: Comparable](collection: list[T]) -> list[T]:
129
"""Pure implementation of the bubble sort algorithm in Python (iterative).
1310

0 commit comments

Comments
 (0)