[Python-Dev] Relative vs. absolute imports

Barry Warsaw barry at python.org
Mon May 17 21:36:31 EDT 2004


On Mon, 2004-05-17 at 18:36, M.-A. Lemburg wrote:

> I still don't believe that we need to break code in order
> to introduce relative imports, though, certainly not
> before Py3k.

One to to "fix" this in a backward compatible way is to instead
introduce a spelling for "really, import this absolutely", e.g.

from __python__ import re

or

import __python__.re

and leave the current import semantics alone, for Python 2.x.  I know
Guido's not in favor of this approach though.

-Barry





More information about the Python-Dev mailing list