> Um, different problem. What Matthias explains is > unavoidable. But in David's case, the containing > namespace (the package) is not empty when > module2 wants module1. In fact, I believe that > sys.modules['package.module1'] is there (though > *it* is empty). > > My guess is that import is looking for module1 > as an attribute of package, and that that binding > hasn't taken place yet. Yes, that's what "from package import module" does -- it wants "module" to be an attribute of "package". This is because it doesn't really distinguish between "from package import module" and "from module import attribute". --Guido van Rossum (home page: http://www.python.org/~guido/)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4