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/2004-April/043982.html below:

[Python-Dev] Re: PEP 328 -- relative and multi-line import

[Python-Dev] Re: PEP 328 -- relative and multi-line importDavid Goodger goodger at python.org
Sat Apr 3 10:44:13 EST 2004
> David Goodger <goodger at python.org> writes:
>> In other words, is the "Y" here acceptable
>> (where Y is a sibling to the current module's package)?
>>
>>     from ..Y import X

David Abrahams wrote:
> Wouldn't that have to be
> 
>        from ...Y import X
>               ^-------------separator, as in A.B
> ??

Aha!  My confusion is confirmed.

I hadn't thought of requiring a separator "."; that seems like
overloading of meaning.  I understood the syntax as Aahz
describes it, so a single leading "." means "current package"
(i.e., sibling of current module), ".." means "parent package"
or "up one level", etc.

> I'm thinking some other syntax is needed to represent upward travel
> in the hierarchy, e.g.
> 
>        from ^.Y import X

That has a certain elegance to it.  So ".Y" would mean import
from current package, "^.Y" would mean import from parent
package, "^^.Y" from parent's parent package, etc.

I don't want to reopen debate needlessly, but the overloading
of the meaning of "." *is* a bit confusing here.

Whatever makes sense to Guido will eventually make sense to me,
so I'm not worried.

-- David Goodger

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