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/2001-November/018557.html below:

Proposal for a modified import mechanism.

[Python-Dev] Re: [Import-sig] Re: Proposal for a modified import mechanism. [Python-Dev] Re: [Import-sig] Re: Proposal for a modified import mechanism.Prabhu Ramachandran Prabhu Ramachandran <prabhu@cyberwaveindia.com>
Mon, 12 Nov 2001 21:23:20 +0530
>>>>> "JCA" == James C Ahlstrom <jim@interet.com> writes:

    JCA> When Python starts, it imports site.py which imports os.py.
    JCA> So os.py gets loaded, and won't normally get re-loaded.  The
    JCA> os.py that gets loaded depends on sys.path.

    JCA> So if os.py is in package1, it won't get loaded for "import
    JCA> os", but it would get loaded for "import package1.os".  Are
    JCA> you saying that "import package1.package2.os" will load
    JCA> package1/os.py?  I hope that "import os" will not load
    JCA> package1/os.py, will it?  Or am I totally confused.

Ummm doing an 'import os' will import the package1/os.py and *not* the
standard one.  This will happen even though os.py was imported earlier
by site.py.  This is what Gordon was objecting to in the first place
and why he proposes using rimport, rrimport etc. to make things more
explicit.

prabhu



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