Skip to content

Commit 634e0af

Browse files
authored
style: update generic functions to Python 3.12 syntax (UP047)
Refactor jump_search to use PEP 695 type parameters [T] as required by the latest Ruff configuration.
1 parent 8dcb65b commit 634e0af

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

searches/jump_search.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def __lt__(self, other: Any, /) -> bool: ...
2020
T = TypeVar("T", bound=Comparable)
2121

2222

23-
def jump_search(arr: Sequence[T], item: T) -> int:
23+
def jump_search[T](arr: Sequence[T], item: T) -> int:
2424
"""
2525
Python implementation of the jump search algorithm.
2626
Return the index if the `item` is found, otherwise return -1.

0 commit comments

Comments
 (0)