Re: [Python-Dev] Re: [Import-sig] Re: Proposal for a modified import
mechanism.
by Prabhu Ramachandran other posts by this author
Nov 12 2001 6:20PM messages near this date
Re: [Python-Dev] Re: [Import-sig] Re: Proposal for a modified import
mechanism.
|
Re: [Python-Dev] Re: [Import-sig] Re: Proposal for a modified import
mechanism.
> >>>> "JH" == Jeremy Hylton <jeremy@[...].com> writes:
> >>>> "PR" == Prabhu Ramachandran <prabhu@[...].in> writes:
PR> Ummm doing an 'import os' will import the package1/os.py and
PR> *not* the standard one. This will happen even though os.py
PR> was imported earlier by site.py. This is what Gordon was
PR> objecting to in the first place and why he proposes using
PR> rimport, rrimport etc. to make things more explicit.
JH> Of course, you can use the existing mechanism to do this:
JH> 'from package1 import os'. The use of an explicit name seems
JH> like the clearest route when you have a package-local module
JH> that shadows a top-level module -- no need to understand
JH> details of relative imports, no question about what is
JH> intended by the code.
JH> I haven't followed this thread closely. Is there some reason
JH> that explicit names in imports is not sufficient?
Yes indeed there is. I've already explained my reasons twice. Eric
also explained why this was important for Scipy.
Anyway, in short, its a big pain re-nesting packages. Also for any
package that has a deep enough structure its a real pain accessing
packages.
from pkg import subpkg is also not the best way to do imports. I
personally prefer import pkg.subpkg and I believe this is the
recommended way of doing imports.
prabhu
_______________________________________________
Import-sig mailing list
Import-sig@[...].org
http://mail.python.org/mailman/listinfo/import-sig
Thread:
eric
Prabhu Ramachandran
Prabhu Ramachandran
Prabhu Ramachandran
Gordon McMillan
James C. Ahlstrom
Barry A. Warsaw
Gordon McMillan
Toby Dickenson
Steve Holden
Barry A. Warsaw
Prabhu Ramachandran
Barry A. Warsaw
Fredrik Lundh
Barry A. Warsaw
Prabhu Ramachandran
Prabhu Ramachandran
Prabhu Ramachandran
Barry A. Warsaw
Michel Pelletier
Prabhu Ramachandran
Michel Pelletier
James C. Ahlstrom
Prabhu Ramachandran
Prabhu Ramachandran
Prabhu Ramachandran
eric
Prabhu Ramachandran
eric
Gordon McMillan
Toby Dickenson
M.-A. Lemburg
Barry A. Warsaw
Fredrik Lundh
Prabhu Ramachandran
Barry A. Warsaw
Michel Pelletier
Prabhu Ramachandran
James C. Ahlstrom
Gordon McMillan
Barry A. Warsaw
Prabhu Ramachandran
Prabhu Ramachandran
Barry A. Warsaw
Prabhu Ramachandran
James C. Ahlstrom
Prabhu Ramachandran
Jeremy Hylton
Prabhu Ramachandran
Jeremy Hylton
Prabhu Ramachandran
Jeremy Hylton
Prabhu Ramachandran
Prabhu Ramachandran
Greg Ward
Just van Rossum
Thomas Heller
Just van Rossum
Jeremy Hylton
Gordon McMillan
Gordon McMillan
Gordon McMillan
Prabhu Ramachandran
Jeremy Hylton
Prabhu Ramachandran
Prabhu Ramachandran
Jeremy Hylton
Prabhu Ramachandran
Jeremy Hylton
Jeremy Hylton
eric
Prabhu Ramachandran
Gordon McMillan
Prabhu Ramachandran
Gordon McMillan
Prabhu Ramachandran
|