Skip to content

Commit 03334d3

Browse files
committed
Mark match functions as private
1 parent 643a091 commit 03334d3

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

bpython/autocomplete.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -197,28 +197,28 @@ def few_enough_underscores(current: str, match: str) -> bool:
197197
return not match.startswith("_")
198198

199199

200-
def method_match_none(word: str, size: int, text: str) -> bool:
200+
def _method_match_none(word: str, size: int, text: str) -> bool:
201201
return False
202202

203203

204-
def method_match_simple(word: str, size: int, text: str) -> bool:
204+
def _method_match_simple(word: str, size: int, text: str) -> bool:
205205
return word[:size] == text
206206

207207

208-
def method_match_substring(word: str, size: int, text: str) -> bool:
208+
def _method_match_substring(word: str, size: int, text: str) -> bool:
209209
return text in word
210210

211211

212-
def method_match_fuzzy(word: str, size: int, text: str) -> Optional[Match]:
212+
def _method_match_fuzzy(word: str, size: int, text: str) -> Optional[Match]:
213213
s = r".*%s.*" % ".*".join(list(text))
214214
return re.search(s, word)
215215

216216

217-
MODES_MAP = {
218-
AutocompleteModes.NONE: method_match_none,
219-
AutocompleteModes.SIMPLE: method_match_simple,
220-
AutocompleteModes.SUBSTRING: method_match_substring,
221-
AutocompleteModes.FUZZY: method_match_fuzzy,
217+
_MODES_MAP = {
218+
AutocompleteModes.NONE: _method_match_none,
219+
AutocompleteModes.SIMPLE: _method_match_simple,
220+
AutocompleteModes.SUBSTRING: _method_match_substring,
221+
AutocompleteModes.FUZZY: _method_match_fuzzy,
222222
}
223223

224224

@@ -231,7 +231,7 @@ def __init__(
231231
mode: AutocompleteModes = AutocompleteModes.SIMPLE,
232232
) -> None:
233233
self._shown_before_tab = shown_before_tab
234-
self.method_match = MODES_MAP[mode]
234+
self.method_match = _MODES_MAP[mode]
235235

236236
@abc.abstractmethod
237237
def matches(

0 commit comments

Comments
 (0)