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

Rocco Moretti roccomoretti at hotpop.com
Wed Mar 17 14:11:18 EST 2004


Aahz wrote:

> In article <104q64b2uf3nl0b at news.supernews.com>,
> John Roth <newsgroups at jhrothjr.com> wrote:

>>A reference beginning in the current directory is thus:
>>
>>import *.spam.eggs
> 
> 
> That's functionally equivalent to the suggested
> 
> import .spam.eggs

I don't see the above syntax referenced in the PEP.

As I read the PEP, I would have thought the above would have been 
prohibited. Quoth the PEP:

"""There does seem to be agreement that relative imports will require 
listing specific names to import (that is, import foo as a bare term 
will always be an absolute import)."""

I took this to mean that relative imports would require the "from ... 
import ... [as ...]" syntax ("listing specific names" of variables in a 
module to import), and "import ..." would always be absolute (importing 
a module as a "bare term" without reference to specific variables to 
import).

I take it since you are the PEP author, this is a mistaken impression. 
But I am at a loss to figure out what exactly is implied by the quoted 
phrase above.

-Rocco



More information about the Python-list mailing list