-
-
Notifications
You must be signed in to change notification settings - Fork 34.5k
gh-69605: Add module autocomplete to PyREPL #129329
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
b3bcd67
Add module autocomplete to PyREPL
tomasr8 bcd3527
Add news entry
tomasr8 df3e8ec
Merge branch 'main' into completer
tomasr8 48ee6ad
Merge branch 'main' into completer
tomasr8 0917d24
Remove attribute completion, never import modules
tomasr8 589cf63
Add type annotations
tomasr8 62d0b55
fix some mypy issues
tomasr8 46ca249
Pass explicit None to find_spec
tomasr8 75e4b55
Merge branch 'main' into completer
tomasr8 3c13f86
Do not suggest modules which are not legal identifiers
tomasr8 8eb656f
Make the tests more robust
tomasr8 7a2fde0
Remove todo comment
tomasr8 5c11124
Move to a separate file and cache ModuleCompleter
tomasr8 10da15b
Avoid calling rstrip more than once
tomasr8 fd81999
Catch exceptions
tomasr8 8fba3d3
Fix tests
tomasr8 f4e290a
Every Reader has its own ModuleCompleter instance
tomasr8 602121d
tests: Only look for modules in the stdlib
tomasr8 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Remove todo comment
- Loading branch information
commit 7a2fde06e0b5cb9310b1947e0f449b2e22a0d39d
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this raise? What do we want to do if any of the pkgutil raises for any reason?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It shouldn't unless
iter_modulesorfind_specraise. Since those can call code from user-supplied finders, they can raise an arbitrary exception. I could add a simpleexcept Exceptionblock and simply return no completions if that happens. To the user it would look like no completions are available rather than outright crashing the repl.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added in fd81999