Skip to content

pyrepl autocomplete from x import <tab> to only display public members #149167

Description

@mpkocher

Feature or enhancement

Proposal:

When using autocomplete in the REPL, from x import <tab> will show all non-underscore prefixed members. This is a dir-like behavior that is useful to inspect and understand what can be imported.

However, this mechanism isn't filtering on __all__ of the module and can yield a long list of non-useful candidates to autocomplete. Two examples shown below, pathlib and collections.abc.

The feature request is that when a user enters from x import <tab> only the candidates defined in __all__ are listed.

Image Image

Has this already been discussed elsewhere?

No response given

Links to previous discussion of this feature:

No response

Linked PRs

Activity

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/ directorytopic-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