From 4bdc46586a13f8728a91cbe32e61a47b5352c9f0 Mon Sep 17 00:00:00 2001 From: Harsh Raj Singhania <40535627+HarshRajSinghania@users.noreply.github.com> Date: Sun, 4 Oct 2026 17:08:30 +0530 Subject: [PATCH] Remove unused TypeVar from bubble sort The PEP 695 type parameters already bound T to Comparable, so the module-level TypeVar was unused. Matches the cleanup requested in TheAlgorithms/Python#15234. --- sorts/bubble_sort.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sorts/bubble_sort.py b/sorts/bubble_sort.py index e8e7ac5a1565..b1a99f674e00 100644 --- a/sorts/bubble_sort.py +++ b/sorts/bubble_sort.py @@ -1,13 +1,10 @@ -from typing import Any, Protocol, TypeVar +from typing import Any, Protocol class Comparable(Protocol): def __lt__(self, other: Any, /) -> bool: ... -T = TypeVar("T", bound=Comparable) - - def bubble_sort_iterative[T: Comparable](collection: list[T]) -> list[T]: """Pure implementation of the bubble sort algorithm in Python (iterative).