summaryrefslogtreecommitdiff
path: root/list_utils.py
diff options
context:
space:
mode:
authorScott <[email protected]>2022-01-07 11:14:29 -0800
committerScott <[email protected]>2022-01-07 11:14:29 -0800
commite8671a716da868332d3ac1f66d4d2f7f8d33fc28 (patch)
treeb62a841528cfc3bc64963666143083fcdac7c975 /list_utils.py
parent5f75cf834725ac26b289cc5f157af0cb71cd5f0e (diff)
Make logging optionally remove global handlers added by (shitty) pip
modules. Make config optionally halt on unrecognized arguments. Make profanity filter smarter.
Diffstat (limited to 'list_utils.py')
-rw-r--r--list_utils.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/list_utils.py b/list_utils.py
index 992f1ae..88c436b 100644
--- a/list_utils.py
+++ b/list_utils.py
@@ -216,6 +216,7 @@ def permute(seq: Sequence[Any]):
"""
yield from _permute(seq, "")
+
def _permute(seq: Sequence[Any], path):
if len(seq) == 0:
yield path
@@ -228,7 +229,7 @@ def _permute(seq: Sequence[Any], path):
yield from _permute(cdr, path + car)
-def binary_search(lst: Sequence[Any], target:Any) -> Tuple[bool, int]:
+def binary_search(lst: Sequence[Any], target: Any) -> Tuple[bool, int]:
"""Performs a binary search on lst (which must already be sorted).
Returns a Tuple composed of a bool which indicates whether the
target was found and an int which indicates the index closest to