MCPcopy Index your code
hub / github.com/python/cpython / is_suggestion_match

Method is_suggestion_match

Lib/_pyrepl/_module_completer.py:195–200  ·  view source on GitHub ↗
(self, module_name: str, prefix: str)

Source from the content-addressed store, hash-verified

193 if self.is_suggestion_match(attr_name, prefix)], None
194
195 def is_suggestion_match(self, module_name: str, prefix: str) -> bool:
196 if prefix:
197 return module_name.startswith(prefix)
198 # For consistency with attribute completion, which
199 # does not suggest private attributes unless requested.
200 return not module_name.startswith("_")
201
202 def iter_submodules(self, parent_modules: list[pkgutil.ModuleInfo]) -> Iterator[pkgutil.ModuleInfo]:
203 """Iterate over all submodules of the given parent modules."""

Callers 2

_find_modulesMethod · 0.95
_find_attributesMethod · 0.95

Calls 1

startswithMethod · 0.45

Tested by

no test coverage detected