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

Barry Warsaw barry at python.org
Fri Sep 10 20:47:56 CEST 2004


On Fri, 2004-09-10 at 13:05, M.-A. Lemburg wrote:

> If that's the only reason, then placing the whole Python standard
> lib under a new top-level package name would be the better
> solution, starting with P3k.

One of my earliest suggestions on the topic did just that.  In fact, you
could do it in a backward compatible way, by introducing an optional
global package.  E.g.

import logging

That would import the local logging.py module if it existed, otherwise
it would import the global logging module.  This is exactly what Python
does today.

from __global__ import logging

That would always import the global logging package.  __global__ is the
optional "fake" global package and would only be used when you want to
explicitly skip any local imports.

IIRC though, Guido never liked this proposal much.  I repost it here on
the off chance that he's way too busy to read every message in this
thread <wink>.

-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/20040910/2db44f51/attachment.pgp


More information about the Python-Dev mailing list