@@ -176,11 +176,11 @@ def from_string(cls, value: str) -> Optional["AutocompleteModes"]:
176176KEYWORDS = frozenset (keyword .kwlist )
177177
178178
179- def after_last_dot (name : str ) -> str :
179+ def _after_last_dot (name : str ) -> str :
180180 return name .rstrip ("." ).rsplit ("." )[- 1 ]
181181
182182
183- def few_enough_underscores (current : str , match : str ) -> bool :
183+ def _few_enough_underscores (current : str , match : str ) -> bool :
184184 """Returns whether match should be shown based on current
185185
186186 if current is _, True if match starts with 0 or 1 underscore
@@ -340,7 +340,7 @@ def locate(self, cursor_offset: int, line: str) -> Optional[LinePart]:
340340 return lineparts .current_word (cursor_offset , line )
341341
342342 def format (self , word : str ) -> str :
343- return after_last_dot (word )
343+ return _after_last_dot (word )
344344
345345
346346def _safe_glob (pathname : str ) -> Iterator [str ]:
@@ -409,14 +409,14 @@ def matches(
409409 return {
410410 m
411411 for m in matches
412- if few_enough_underscores (r .word .split ("." )[- 1 ], m .split ("." )[- 1 ])
412+ if _few_enough_underscores (r .word .split ("." )[- 1 ], m .split ("." )[- 1 ])
413413 }
414414
415415 def locate (self , cursor_offset : int , line : str ) -> Optional [LinePart ]:
416416 return lineparts .current_dotted_attribute (cursor_offset , line )
417417
418418 def format (self , word : str ) -> str :
419- return after_last_dot (word )
419+ return _after_last_dot (word )
420420
421421 def attr_matches (self , text : str , namespace : Dict [str , Any ]) -> List :
422422 """Taken from rlcompleter.py and bent to my will."""
@@ -434,8 +434,7 @@ def attr_matches(self, text: str, namespace: Dict[str, Any]) -> List:
434434 obj = safe_eval (expr , namespace )
435435 except EvaluationError :
436436 return []
437- matches = self .attr_lookup (obj , expr , attr )
438- return matches
437+ return self .attr_lookup (obj , expr , attr )
439438
440439 def attr_lookup (self , obj : Any , expr : str , attr : str ) -> List :
441440 """Second half of attr_matches."""
@@ -631,7 +630,7 @@ def matches(
631630
632631 # strips leading dot
633632 matches = (m [1 :] for m in self .attr_lookup (obj , "" , attr .word ))
634- return {m for m in matches if few_enough_underscores (attr .word , m )}
633+ return {m for m in matches if _few_enough_underscores (attr .word , m )}
635634
636635
637636try :
0 commit comments