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/2009-April/088018.html below:

[Python-Dev] Broken import?

[Python-Dev] Broken import? [Python-Dev] Broken import?Greg Ewing greg.ewing at canterbury.ac.nz
Wed Apr 1 13:11:10 CEST 2009
Nick Coghlan wrote:

> 'import a.b.c' will look in sys.modules for "a.b.c", succeed and work,
> even if "a.b.c" is in the process of being imported.
> 
> 'from a.b import c' (or 'from . import c' in a subpackage of "a.b") will
> only look in sys.modules for "a.b", and then look on that object for a
> "c" attribute. The cached "a.b.c' module in sys.modules is ignored.

Hasn't 'from a.b import c' always been that way, though?
Is the problem just that relative imports make it easier
to run into this behaviour, or has something about the
way imports work changed?

-- 
Greg
More information about the Python-Dev mailing list

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