GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||
GeezerVison is showing github.com — gh-69605: Hardcode some stdlib submodules in PyREPL module completion (os.path, collections.abc...) by loic-simon · Pull Request #138268 · python/cpython Conversation
|
|
Thanks! I was planning to implement this at some point, but you beat me to it :) I haven't checked too deeply, but we should make sure to only autocomplete these submodules when we are sure they are coming from the stdlib. We do not want to autocomplete them when a user intentionally shadows an stdlib module with their own because in that case they might not exist. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Yeah, I wondered about that, I'll check if we have a reliable and fast way to check this. Just looking at A side note on this: when testing the current behavior by creating a folder % mkdir collections % touch collections/__init__.py collections/foo.py % python Python 3.14.0rc2 [...] >>> from collections import <TAB> >>> from collections import foo Traceback (most recent call last): File "<python-input-0>", line 1, in <module> from collections import foo ImportError: cannot import name 'foo' from 'collections' (/Users/loic/cpython/Lib/collections/__init__.py) >>> % python -c "from collections import foo; print(foo)" <module 'collections.foo' from '/Users/loic/test/collections/foo.py'> Not directly related, but it may be cool to check if the name to complete is already in |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks @loic-simon for the PR, and @ambv for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…letion (os.path, collections.abc...) (pythonGH-138268) (cherry picked from commit 537133d) Co-authored-by: Loïc Simon <[email protected]> Co-authored-by: Łukasz Langa <[email protected]>
|
GH-138943 is a backport of this pull request to the 3.14 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Adressed in #139461. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…pletion (os.path, collections.abc...) (GH-138268) (GH-138943) (cherry picked from commit 537133d) Co-authored-by: Loïc Simon <[email protected]> Co-authored-by: Łukasz Langa <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.