A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2002-June/024936.html below:

[Python-Dev] intra-package mutual imports fail: "from <pkg> import <mod>"

[Python-Dev] intra-package mutual imports fail: "from <pkg> import <mod>" [Python-Dev] intra-package mutual imports fail: "from <pkg> import <mod>"Guido van Rossum guido@python.org
Mon, 03 Jun 2002 10:21:04 -0400
> 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