[issue24949] Identifier lookup in a multi-level package is flakey

Bob Hossley report at bugs.python.org
Mon Aug 31 23:58:20 CEST 2015


Bob Hossley added the comment:

msg249272

Thank you Martin Panter for the documentation URL's.  The import machinery is so complicated that I have given up trying to understand what is "correct" behavior.    Depending on the code in the relevant __init__.py and/or explicitly referenced Python modules each Python library can have vastly different import behavior.  I believe the simplest way to figure out what an import does and hence, what import statements I need is to run a Python interpreter in a terminal, execute an import statement, and then use the dir() function several times to see what the import statement did.

The import documentation is only slightly useful due to its great length and complexity.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue24949>
_______________________________________


More information about the Python-bugs-list mailing list