Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit03334d3

Browse files
committed
Mark match functions as private
1 parent643a091 commit03334d3

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
returnnotmatch.startswith("_")
198198

199199

200-
defmethod_match_none(word:str,size:int,text:str)->bool:
200+
def_method_match_none(word:str,size:int,text:str)->bool:
201201
returnFalse
202202

203203

204-
defmethod_match_simple(word:str,size:int,text:str)->bool:
204+
def_method_match_simple(word:str,size:int,text:str)->bool:
205205
returnword[:size]==text
206206

207207

208-
defmethod_match_substring(word:str,size:int,text:str)->bool:
208+
def_method_match_substring(word:str,size:int,text:str)->bool:
209209
returntextinword
210210

211211

212-
defmethod_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
returnre.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
defmatches(

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp