Comment 6 for bug 1270169

Revision history for this message
spaceone (spaceone) wrote :

And you cannot use foo.bar.baz because this does not exists because the module is not yet appended to foo.bar;

$ cat foo/bar/__init__.py
import foo.bar.baz

baz.test()
foo.bar.baz.test()

$ python
>>> import foo
TEST OK
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "./foo/__init__.py", line 1, in <module>
    import foo.bar
  File "./foo/bar/__init__.py", line 4, in <module>
    foo.bar.baz.test()
AttributeError: 'module' object has no attribute 'bar'

With the first line i can access the function, the other one not!