File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed
Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change 1- #!/usr/bin/env python3
1+ # mypy: ignore-errors
2+ # #!/usr/bin/env python3
23"""
34Pure Python implementations of binary search algorithms.
45
1415from itertools import pairwise
1516from typing import TypeVar
1617
18+
1719__all__ = [
18- "bisect_left" ,
19- "bisect_right" ,
20- "insort_left" ,
21- "insort_right" ,
2220 "binary_search" ,
21+ "binary_search_by_recursion" ,
2322 "binary_search_std_lib" ,
2423 "binary_search_with_duplicates" ,
25- "binary_search_by_recursion" ,
24+ "bisect_left" ,
25+ "bisect_right" ,
2626 "exponential_search" ,
27+ "insort_left" ,
28+ "insort_right" ,
2729]
2830
2931# ---------------------------------------------------------------------------
3032# Generic comparable type
3133# ---------------------------------------------------------------------------
3234
33- T = TypeVar ("T" ) # Must support < via __lt__; mirrors what bisect itself accepts.
35+ T = TypeVar ("T" ) # Must support < via __lt__; mirrors what bisect itself accepts.
3436
3537
3638# ---------------------------------------------------------------------------
@@ -423,4 +425,4 @@ def exponential_search(sorted_collection: Sequence[T], item: T) -> int:
423425 if result == - 1 :
424426 print (f"{ target } was not found in { collection } ." )
425427 else :
426- print (f"{ target } was found at index { result } of { collection } ." )
428+ print (f"{ target } was found at index { result } of { collection } ." )
You can’t perform that action at this time.
0 commit comments