8000 gh-134235: Import Autocomplete for Builtin Modules by tommix626 · Pull Request #134277 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-134235: Import Autocomplete for Builtin Modules #134277

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
May 19, 2025
Prev Previous commit
Next Next commit
change var name for type check
  • Loading branch information
tommix626 committed May 19, 2025
commit b8402ebad2c80bf3c699880beaee01887db0f035
6 changes: 3 additions & 3 deletions Lib/_pyrepl/_module_completer.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ def find_modules(self, path: str, prefix: str) -> list[str]:
def _find_modules(self, path: str, prefix: str) -> list[str]:
if not path:
# Top-level import (e.g. `import foo<tab>`` or `from foo<tab>`)`
builtins = [name for name in sys.builtin_module_names if name.startswith(prefix)]
modules = [name for _, name, _ in self.global_cache if name.startswith(prefix)]
return sorted(builtins + modules)
builtin_modules = [name for name in sys.builtin_module_names if name.startswith(prefix)]
third_party_modules = [name for _, name, _ in self.global_cache if name.startswith(prefix)]
return sorted(builtin_modules + third_party_modules)

if path.startswith('.'):
# Convert relative path to absolute path
Expand Down
0