Skip to content

Commit ca2306d

Browse files
authored
style: update jump_search to use PEP 695 type parameters
Updated the jump_search function signature to use the Python 3.12+ generic type parameter syntax [T]. This resolves the UP047 linting error flagged by Ruff.
1 parent fcdf5f1 commit ca2306d

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)