Nick Coghlan added the comment:

As Steven notes, packages are simply modules that reserve the right to contain 
other submodules

As a result, Python considers "aaa.py", "aaa.pyc", "aaa.<C_extension_suffix>", 
"aaa/__init__.py", and "aaa/__init__.pyc" all to be candidate filesystem 
mappings for a module named "aaa", and once it finds one of them, it will 
ignore the others (the "module shadowing" Steven mentions).

The last time changing this was seriously considered was when native namespace 
package support was added in PEP 420: https://www.python.org/dev/peps/pep-0420/

Specifically, one of the competing proposals was PEP 402, which proposed 
allowing all modules to implicitly also be namespace packages: 
https://www.python.org/dev/peps/pep-0402/

This was ultimately rejected in favour of the approach in PEP 420, where single 
file modules, self-contained packages, and native namespace packages all have 
clearly distinct filesystem layouts.

----------
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue30503>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to