Skip to content

Commit 2e0c3a3

Browse files
style: add explicit type hints to linear_search.py
1 parent 6c04620 commit 2e0c3a3

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

searches/linear_search.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
For manual testing run:
88
python3 linear_search.py
99
"""
10+
from typing import Any
1011

11-
12-
def linear_search(sequence: list, target: int) -> int:
12+
def linear_search(sequence: list[Any], target: Any) -> 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,7 @@ 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(sequence: list[Any], low: int, high: int, target: Any) -> int:
3737
"""
3838
A pure Python implementation of a recursive linear search algorithm
3939

0 commit comments

Comments
 (0)