Skip to content

PyREPL: Do not show underscored modules by default during autocompletion #134215

Closed
@tomasr8

Description

@tomasr8

Feature or enhancement

Proposal:

Attribute autocomplete in the new REPL does not show underscored names unless specifically asked for:

>>> class Foo:
...     _foo = 2
...     foo = 3
...     
>>> Foo.<tab>
Foo.foo    Foo.mro()

Note that only Foo.foo is offered. To also get Foo._foo, we need to write Foo._<tab>. We should do the same for the import autocomplete.
Currently it just shows all modules/submodules, including those starting with an underscore:

>>> from importlib import <tab>
_abc                 _bootstrap_external  machinery            readers              simple                                                         
_bootstrap           abc                  metadata             resources            util

Please don't pick up this issue, I'd like to reserve it for someone at the PyConUS sprints :)

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

No response

Linked PRs

Activity

kevteg

kevteg commented on May 19, 2025

@kevteg
Contributor

I'm taking a look! (I'm at pycon us sprints)

added a commit that references this issue on May 19, 2025

pythongh-134215: Improve ModuleCompleter module

added a commit that references this issue on May 20, 2025

gh-134215: PyREPL: Do not show underscored modules by default during …

a3a3cf6
added a commit that references this issue on May 20, 2025

pythongh-134215: PyREPL: Do not show underscored modules by default d…

added a commit that references this issue on May 20, 2025

[3.14] gh-134215: PyREPL: Do not show underscored modules by default …

69710b7
tomasr8

tomasr8 commented on May 20, 2025

@tomasr8
MemberAuthor

Thanks @kevteg for tackling this!

added a commit that references this issue on May 26, 2025

pythongh-134215: PyREPL: Do not show underscored modules by default d…

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

Metadata

Metadata

Assignees

Labels

easytopic-replRelated to the interactive shelltype-featureA feature request or enhancement

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    PyREPL: Do not show underscored modules by default during autocompletion · Issue #134215 · python/cpython

    Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

    Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant