On 2 Jun 2002 at 9:25, Guido van Rossum wrote: [Matthias Urlichs] > > The problem is that importing with from consists of > > two steps: - load the module - add the imported names > > to the local namespace > > Good explanation! This means it's an unavoidable > problem. 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. If I use iu instead of the builtin import, it works. -- Gordon http://www.mcmillan-inc.com/
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