PEP 328: Imports: Multi-Line and Absolute/Relative

Aahz aahz at pythoncraft.com
Wed Mar 10 05:49:30 EST 2004


In article <104q64b2uf3nl0b at news.supernews.com>,
John Roth <newsgroups at jhrothjr.com> wrote:
>
>I think this is a serious conceptual issue, and I'd prefer to not
>support upwards references at all.  That doesn't mean they should be
>prohibited, but if someone wants to dig a pit for himself with circular
>coupling across module hierarchies, then he should be required to
>wield the shovel himself. It is not, after all, that difficult to
>sort through sys.modules to figure out where you are in the import
>hierarchy.

While that makes some sense, what about "uncle" references within the
current package?

>That leaves references to the current package.  I'm going to suggest an
>"*" as an indicator for "this package." The reason for an asterisk is
>my background in mainframe assembler: it means "here" in that language,
>so I'm obviously not particularly attached to it. It's also already in
>use in the "from foo import *" syntax.
>
>A reference beginning in the current directory is thus:
>
>import *.spam.eggs

That's functionally equivalent to the suggested

import .spam.eggs
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"Do not taunt happy fun for loops. Do not change lists you are looping over."
--Remco Gerlich, comp.lang.python



More information about the Python-list mailing list