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

Bob Hossley report at bugs.python.org
Mon Aug 31 23:56:32 CEST 2015


Bob Hossley added the comment:

msg<249269>

Thank you David Murray.

I should have asked myself, what is reasonable behavior?  In the case of email.mime.nonmultipart an explicit import is clearly needed.

I was misled by my experience with the os library.  As a "package" it is very different from the email library.  Importing os also makes available all of what appear at the script syntax level to be all its "sub-packages."

2015-08-28 09:57:26 /home/bob06
$ python
Python 2.7.6 (default, Jun 22 2015, 17:58:13) 
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> print(os.path.split)
<function split at 0x7fac18704320>

In the future I will try to remember that the effects of importing a "package" depend on how the "package" is packaged.

So far as I'm concerned this issue is closed.

I doubt that symptom "flakey Python behavior" is serious enough to interest Canonical.

----------

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


More information about the Python-bugs-list mailing list