[Python-Dev] Re: PEP 328 - Relative Imports

Barry Warsaw barry at python.org
Mon Sep 13 03:40:32 CEST 2004


On Fri, 2004-09-10 at 18:51, Nicolas Fleury wrote:

> I agree with Guido.  FWIW, I think imports should be absolute by default 
> and that the statu quo is a mistake.  The __global__ solution makes 
> absolute imports too verbose, when they are usually in majority.  

I'm really not trying to argue strongly that __global__ is a solution,
but let me just point out that I think they wouldn't be that common. 
You'd add an __global__ only when the "normal" import statement didn't
do what you want, primarily because of a local module name that
conflicted with a global module, and you really wanted the global. 
Ordinarily, those conflicts don't occur.  OTOH, when they do, you can
often "fix" the problem by renaming your local module, but that's a bit
ugly.

-Barry

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 307 bytes
Desc: This is a digitally signed message part
Url : http://mail.python.org/pipermail/python-dev/attachments/20040912/22303763/attachment.pgp


More information about the Python-Dev mailing list