Skip to content

Commit f976db3

Browse files
authored
Update type hints for linear search functions
1 parent 791deb4 commit f976db3

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

searches/linear_search.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"""
1010

1111

12-
def linear_search(sequence: list, target: int) -> int:
12+
def linear_search(sequence: list[int], target: int) -> int:
1313
"""A pure Python implementation of a linear search algorithm
1414
1515
:param sequence: a collection with comparable items (sorting is not required for
@@ -33,7 +33,9 @@ def linear_search(sequence: list, target: int) -> int:
3333
return -1
3434

3535

36-
def rec_linear_search(sequence: list, low: int, high: int, target: int) -> int:
36+
def rec_linear_search(
37+
sequence: list[int], low: int, high: int, target: int
38+
) -> int:
3739
"""
3840
A pure Python implementation of a recursive linear search algorithm
3941

0 commit comments

Comments
 (0)