[Python-Dev] Re: Relative import

Guido van Rossum guido at python.org
Wed Dec 17 19:24:13 EST 2003

> So, why not this?
> from ... import x

Yes, I forgot about that.  My original proposal allowed using just one
or more dots; the three-dots proposal with scan-up semantics should
also allow just that.  In terms of the Grammar file:

dotted_name: NAME ('.' NAME)* | '...' [NAME ('.' NAME)*]

BTW, it seems that for breaking up long imports, the parentheses
proposal has received universal acclaim.  So if we add either of the
dotted-from proposals to 2.4, we should also add the parenthesized
syntax: from ...... import (......), and for symmetry also without

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

More information about the Python-Dev mailing list