-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
PyREPL: autocomplete built-in modules #134235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue an 8000 d 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
Comments
has anyone claimed this? I'm in the new sprinters room and would be happy to hand it to someone. |
@gpshead, I wouldn't say I've claimed this yet but I'm looking at it. I'm in the same room. :) |
@newbery I'm in 316, let me know if you need help 🙂 |
@newbery I'm also looking into this, any updates now? Can I help along? I'm in 315. |
I have a fix. Trying to go through post steps of adding test cases, etc. |
Also have a fix! @hyoung3 want to meet and sync up? Hope to learn from you on the contribution process. (Are you at Pycon?) |
Hi @tommix626, yes. I'm in the beginners room. |
@tommix626 , @hyoung3 |
@newbery we are trying to figure out 8000 a test now as one doesn't explicitly test the method we updated. If you have some ideas we'd be interested to hear. |
@tomasr8 we are having a "pulling our hair out" issue. You have a second to stop by? |
* added enhancement auto completing import with sys builtins --------- Co-authored-by: Hunter <hyoung3@gmail.com>
thanks everyone! this is featurey but i feel like this was intended for 3.14 with the autcomplete feature so i went ahead with the backport. if others or the release manager disagree, they can undo it in the 3.14 branch. :) |
Thank you! I wasn't sure whether to mark this as a bug or a feature, but it makes sense to backport this :) |
Uh oh!
There was an error while loading. Please reload this page.
Feature or enhancement
Proposal:
Currently, built-in modules (i.e.
sys
) are not autocompleted in the new REPL. For instance, typingimport sy<tab>
does not offersys
as a completion possibility.This is because we use
pkgutil.iter_modules
under the hood. Since built-in modules have no underlying.py
file, they don't show up.It would be great if the autocomplete could still work with these modules. One possibility would be looking at
sys.builtin_module_names
and combining it with the results ofpkgutil.iter_modules
.The relevant code is in this class:
cpython/Lib/_pyrepl/_module_completer.py
Lines 24 to 26 in cc9add6
Here's how I think we can implement it:
sys.builtin_module_names
ModuleCompleter.global_cache
(might need changing how we represent the modules)IIUC we only have built-in top-level modules, not submodules, so that should simplify the implementation.
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
The text was updated successfully, but these errors were encountered: