Skip to content

Commit 0cfbd99

Browse files
committed
Make return value and type of _method_match_fuzzy consistent with other match functions
1 parent 03334d3 commit 0cfbd99

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

bpython/autocomplete.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,9 @@
4242
Dict,
4343
Iterator,
4444
List,
45-
Match,
4645
Optional,
4746
Set,
48-
Union,
4947
Tuple,
50-
Type,
5148
Sequence,
5249
)
5350
from . import inspection
@@ -209,9 +206,9 @@ def _method_match_substring(word: str, size: int, text: str) -> bool:
209206
return text in word
210207

211208

212-
def _method_match_fuzzy(word: str, size: int, text: str) -> Optional[Match]:
209+
def _method_match_fuzzy(word: str, size: int, text: str) -> bool:
213210
s = r".*%s.*" % ".*".join(list(text))
214-
return re.search(s, word)
211+
return re.search(s, word) is not None
215212

216213

217214
_MODES_MAP = {

0 commit comments

Comments
 (0)