pyrepl autocomplete from x import <tab> to only display public members
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 35.9k
- PR merge metrics
- PR metrics pending
Description
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.
Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response
Linked PRs
- gh-156146
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in the pyrepl autocomplete entry point for from x import <tab> and inspect the existing dir-like candidate filtering. Check the autocomplete tests, if present, and use the pathlib and collections.abc examples from the issue to verify that only names exposed by __all__ are listed; the linked PR gh-156146 indicates work is already underway.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100