python - Does __init__.py create a namespace, or does it take on the pkg-namespace? -



python - Does __init__.py create a namespace, or does it take on the pkg-namespace? -

foopkg |- __init__.py |- bar.py |- baz.py __init__.py bar import * baz import * suds.client import client client bar.py class croak: import foopkg foopkg.client()

python3.2>> import foopkg

attributeerror: 'module' object has no attribute 'client'

why??

you importing bar before client. so, @ moment foopkg.client() gets executed foopkg has no client yet.

python python-3.x

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -