-
Notifications
You must be signed in to change notification settings - Fork 765
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
Remove auto-import when typing the letter d to avoid being serenaded with The Zen of Python #2535
Comments
This is both hysterical and very annoying. :) this.py is part of the stdlib that was added as an Easter egg in PEP 20. @heejaechang, perhaps we should ban this.py from auto-import? Or maybe we should never offer auto-imports for single letter identifiers? |
should we also suggest adding '_' to the front of those variables in https://github.com/python/cpython/blob/main/Lib/this.py |
Had this occurred 3 days prior I would have assumed it was an April Fool's joke! |
Would it be possible to add the option to "whitelist" some packages in |
For this issue and #4229, we should exclude Easter egg stdlib modules from auto-import. Are there more than |
user can use ex)
that said, I think it is good idea to filter them out from our indices at the first place. |
This issue has been fixed in prerelease version 2023.5.11, which we've just released. You can find the changelog here: CHANGELOG.md |
Hello,
After a lot of head scratching as to why my python script was suddenly reciting The Zen of Python this afternoon, I learned it was because my code had
from this import d
added to the top. I did not type that though.After more head scratching I learned it was because I had typed a single letter
d
and accidentally hit enter before finishing my variable. CapitalD
triggers this as well.I see how the auto-import functions are useful, but since this particular case adds a module that outputs a lengthy poem, perhaps this can be disabled, or more text can be required, or there can be a two-step confirmation process? It has bungled up at least one other person.
The text was updated successfully, but these errors were encountered: