[issue34414] Absolute imports conflict with local files

Jonathan Hadida report at bugs.python.org
Fri Aug 17 06:05:30 EDT 2018


Jonathan Hadida <ariel.hadida at gmail.com> added the comment:

Thanks again for your reply, I really appreciate your time.

Every language I know has reserved keywords, and a restricted syntax. Nothing to complain about there. Banning the use of tabs (PEP8) is pretty odd; but restricting file-names is just a whole new level. 

Is the list of python modules set in stone somewhere, or are we supposed to rename scripts every time a new module with a conflicting name is introduced?

Should we start checking for the authenticity of the modules loaded when writing a Python library? Maybe keep a version-specific, platform-specific list of checksums and iterate all builtin modules at the beginning of any script?

Not being able to tell whether "import math" will load the standard math module, not only because of the names of local files, **but also because of those surrounding ANY script that will ever load my library**; are we supposed to control for the user's folders too then? I would happily stop complaining and just reverse sys.path at the beginning of my script if I could, but I cannot even trust that "import sys" will work as intended!

What a feature.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34414>
_______________________________________


More information about the Python-bugs-list mailing list