[Python-Dev] Relative import

Jack Jansen Jack.Jansen at cwi.nl
Tue Dec 16 16:09:59 EST 2003


On 16-dec-03, at 19:26, Guido van Rossum wrote:

> There is the remaining issue of what exactly the syntax would be.  I
> propose to extend the from clause to allow one or more dots before the
> dotted name, and to make the dotted name optional if at least one
> leading dot is found.  I propose not to change from-less import.
> Examples:
>
>   from .foo import bar
>   from .foo.bar import xxx
>   from . import foobar as barfoo
>   from ..foo.bar import *
>   from ... import foobar, barfoo

Is "from . import *" allowed? Whenever I start to think about it I
tend to go into oscillation (yes because within package foo its the same
as "from foo import *" on the outside; no because "import *" isn't
allowed today either).
--
Jack Jansen, <Jack.Jansen at cwi.nl>, http://www.cwi.nl/~jack
If I can't dance I don't want to be part of your revolution -- Emma 
Goldman




More information about the Python-Dev mailing list