Repository navigation
PyREPL: auto-complete module attributes in import statements #140870
Description
Activity
- addedtype-featureA feature request or enhancementA feature request or enhancement
on Nov 1, 2025 - addedstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-replRelated to the interactive shellRelated to the interactive shell
on Nov 1, 2025 Looks like Pablo beat me to it 😆 I'm really sorry I but I've had very limited time in the last couple of months due to family.. Thanks a lot @loic-simon for getting it across the finish line, it's great to finally have it merged! :)
Reacted by Loïc SimonThanks a lot for your contribution @loic-simon 🚀
Also, now that #130473 is merged as well, it'd be nice to get the same colored completion for import attributes as well. I'm having a look but at a minimum I think we'll need to:
- Make module completer return attribute values, not just the names
- Extract
colorize_matchesfrom FancyCompleter and reuse it for imports
Reacted by Loïc SimonOh yes, that would be great! Don't hesitate to ping me for any review/help 👌
Hey, should this change be included in the What's New?
Since there is already a "default interactive shell" section with fancycompleter changes, I guess it would make sense?Gentle ping @pablogsal (as you merged this) and @hugovk (as What's New editor), happy to draft a PR if needed, I'm not sure what the process is :)
- added a commit that references this issue
on Sep 4, 2026 - added a commit that references this issue
on Sep 5, 2026
Feature or enhancement
Proposal:
Support for auto-completion of import statements can be separated between
As discussed on Discourse, automatically importing modules when pressing TAB would be too intrusive and unsafe, considering import-time side effects.
A solution that seems acceptable to most people, though, is to prompt the user to press TAB again to import the module and see its contents.
Has this already been discussed elsewhere?
I have already discussed this feature proposal on Discourse
Links to previous discussion of this feature:
https://discuss.python.org/t/looking-for-feedback-on-adding-import-autocomplete-to-pyrepl/82281
Linked PRs