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

javascript - THREE.js reposition vertices for RingGeometry -

javascript - I need to update the text of a paragraph by inline edit -

assembly - What is the addressing mode for ld, add, and rjmp instructions? -