GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — PyREPL: auto-complete module attributes in import statements · Issue #140870 · python/cpython

PyREPL: auto-complete module attributes in import statements #140870

New issue
Copy link
New issue
Copy link
Closed
Closed
PyREPL: auto-complete module attributes in import statements#140870
Copy link
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-replRelated to the interactive shellRelated to the interactive shelltype-featureA feature request or enhancementA feature request or enhancement

Description

@loic-simon
loic-simon
opened on Nov 1, 2025
Issue body actions

Feature or enhancement

Proposal:

Support for auto-completion of import statements can be separated between

  • Modules suggestions (Readline completion of module names in import statements #69605): done by @tomasr8 🎉
  • Attributes suggestions: more complex, since we cannot reliably know which attributes to suggest if their module is not imported yet.

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

  • gh-140870: PyREPL auto-complete module attributes in import statements  #140871
  • gh-140870: Full coverage for _pyrepl._module_completer #143244
  • [3.14] gh-140870: Full coverage for _pyrepl._module_completer (GH-143244) #143260
  • gh-140870: Add PyREPL's module attributes import completion feature to What's New #156782
  • [3.15] gh-140870: Add PyREPL's module attributes import completion feature to What's New 3.15 (GH-156782) #156945

Activity

  1. loic-simon
    added
    type-featureA feature request or enhancementA feature request or enhancement
    on Nov 1, 2025
  2. loic-simon
    added 2 commits that reference this issue on Nov 1, 2025

    pythongh-140870 PyREPL: add import completion for attributes

    e392ab6

    pythongh-140870 PyREPL: add import completion for attributes

    1bbfb9b
  3. picnixz
    added
    stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
    topic-replRelated to the interactive shellRelated to the interactive shell
    on Nov 1, 2025
  4. tomasr8
    added a commit that references this issue on Dec 28, 2025

    gh-140870: Full coverage for _pyrepl._module_completer (#143244)

    c3febba
  5. miss-islington
    added a commit that references this issue on Dec 28, 2025

    pythongh-140870: Full coverage for _pyrepl._module_completer (pythonG…

    b4c47f8
  6. tomasr8
    added a commit that references this issue on Dec 28, 2025

    [3.14] gh-140870: Full coverage for _pyrepl._module_completer (GH-143244

    b097fa1
  7. thunder-coding
    added a commit that references this issue on Feb 15, 2026

    pythongh-140870: Full coverage for _pyrepl._module_completer (python#…

    90119d3
  8. loic-simon commented on Apr 5, 2026

    @loic-simon
    loic-simon
    on Apr 5, 2026
    ContributorAuthor
    More actions

    @tomasr8 @ambv Hey, we're now 1 month from the 3.15 feature freeze, do you think #140871 could make it? 🙏
    Please tell me if there's anything more I can do!

  9. pablogsal
    added 2 commits that reference this issue on Apr 5, 2026

    pythongh-140870 PyREPL: add import completion for attributes

    099cf71

    gh-140870: PyREPL auto-complete module attributes in import statements (

    b07becb
  10. tomasr8 commented on Apr 5, 2026

    @tomasr8
    tomasr8
    on Apr 5, 2026
    Member
    More actions

    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 Simon
  11. pablogsal
    closed this as completedon Apr 5, 2026
  12. pablogsal commented on Apr 5, 2026

    @pablogsal
    pablogsal
    on Apr 5, 2026
    Member
    More actions

    Thanks a lot for your contribution @loic-simon 🚀

  13. tomasr8 commented on Apr 5, 2026

    @tomasr8
    tomasr8
    on Apr 5, 2026
    Member
    More actions

    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_matches from FancyCompleter and reuse it for imports
    Reacted by Loïc Simon
  14. loic-simon commented on Apr 5, 2026

    @loic-simon
    loic-simon
    on Apr 5, 2026
    ContributorAuthor
    More actions

    Oh yes, that would be great! Don't hesitate to ping me for any review/help 👌

  15. ljfp
    added a commit that references this issue on Apr 25, 2026

    pythongh-140870: PyREPL auto-complete module attributes in import sta…

    597be3e
  16. loic-simon commented on Jun 2, 2026

    @loic-simon
    loic-simon
    on Jun 2, 2026
    ContributorAuthor
    More actions

    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?

  17. loic-simon commented on Jul 18, 2026

    @loic-simon
    loic-simon
    on Jul 18, 2026
    ContributorAuthor
    More actions

    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 :)

  18. loic-simon
    added a commit that references this issue on Sep 1, 2026

    Add pythongh-140870 (PyREPL import attributes completion) to What's New

    6d46cfa
  19. StanFromIreland
    added a commit that references this issue on Sep 4, 2026

    gh-140870: Add PyREPL's module attributes import completion feature t…

    1a2e3a0
  20. hugovk
    added a commit that references this issue on Sep 5, 2026

    [3.15] gh-140870: Add PyREPL's module attributes import completion fe…

    a8a2010
  21. clin1234
    added a commit that references this issue on Sep 12, 2026

    pythongh-140870: Add PyREPL's module attributes import completion fea…

    4c1d47c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-replRelated to the interactive shellRelated to the interactive shelltype-featureA feature request or enhancementA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.