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/044005.html below:

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

[Python-Dev] Re: PEP 328 -- relative and multi-line import [Python-Dev] Re: PEP 328 -- relative and multi-line importGuido van Rossum guido at python.org
Sat Apr 3 16:25:30 EST 2004
> > One more (possibly unclear) case to consider:
> >     import . as package
> > Is this a way to name your parent package?
> 
> Nope.  All uses of relative imports require ``from <something> import``

Right.

> (I think the PEP makes that clear).  You could, however, do
> 
>     from ... import package [as foo]
> 
> if Guido permits it; I want a Pronouncement on that before adding it
> to the PEP.

Yes, even if ... refers to the root package (but not if it tries to
reach beyond that).  But this doesn't handle his case: what he wanted
(if it were allowed) would rename the current package to 'package' no
matter what its real name.  Not that I care about that use case. :-)

--Guido van Rossum (home page: http://www.python.org/~guido/)

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