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

Method format_completion

Lib/_pyrepl/_module_completer.py:234–237  ·  view source on GitHub ↗
(self, path: str, module: str)

Source from the content-addressed store, hash-verified

232 return path, prefix
233
234 def format_completion(self, path: str, module: str) -> str:
235 if path == '' or path.endswith('.'):
236 return f'{path}{module}'
237 return f'{path}.{module}'
238
239 def _resolve_relative_path(self, path: str) -> str | None:
240 """Resolve a relative import path to absolute. Returns None if unresolvable."""

Callers 1

completeMethod · 0.95

Calls 1

endswithMethod · 0.45

Tested by

no test coverage detected