[Python-Dev] Re: Christmas Wishlist

Guido van Rossum guido at python.org
Mon Dec 15 11:03:31 EST 2003


> Barry Warsaw writes:
>  > V <wink>. Explicit global imports.  I want a way to spell "import this
>  > from the global standard library even if there's a this.py  in the local
>  > directory".
> 
> I like the syntax:
> 
>     import global <dotted-name>
> 
> and
> 
>     from global <dotted-name> import <name>
> 
> Look Guido, no new keywords!  ;-)

I'd much rather invent new syntax to spell *local* imports.  I like

  from .module import something

You can even generalize and write

  from ..module import something

to reference your package's parent package. :-)

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



More information about the Python-Dev mailing list