[Python-bugs-list] [ python-Bugs-493628 ] import not pythonic in 2.1.1
noreply@sourceforge.net
noreply@sourceforge.net
Sat, 15 Dec 2001 03:38:00 -0800
Bugs item #493628, was opened at 2001-12-15 03:37
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=493628&group_id=5470
Category: Python Interpreter Core
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Chris Withers (fresh)
Assigned to: Nobody/Anonymous (nobody)
Summary: import not pythonic in 2.1.1
Initial Comment:
Take a package 'aPackage', which contains a sub-package 'aSubPackage' that in turn contains a
module 'aModule' that defines a class 'aClass'.
If I do:
import aPackage.aSubPackage
print aPackage.aSubPackage.aModule
I get:
Traceback (most recent call last):
File "x.py", line xx, in ?
print aPackage.aSubPackage.aModule
AttributeError: 'aPackage.aSubPackage' module has no attribute 'aModule'
A yet, if I do:
import aPackage.aSubPackage.aModule
print aPackage.aSubPackage.aModule
I get:
<module 'aPackage.aSubPackage.aModule' from 'some_path'>
...as expected, which is very confusing and doesn't feel 'right' :-S
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=493628&group_id=5470