James Tauber

journeyman of some

blog > 2006 > 02 > 15 >

Are Absolute Imports Available in Python 2.4 or Not?

PEP 328 looks like it will solve my recent import issues.

However, the PEP mentions that

In Python 2.4, you must enable the new absolute import behavior with from __future__ import absolute_import

which got me excited because it means I don't need to wait for Python 2.5 to take advantage of it.

However

from __future__ import absolute_import

gives

SyntaxError: future feature absolute_import is not defined

So that part of PEP 328 was just teasing me. I think it's an error in the PEP.

Categories:
prev « python » next
prev « pyworks

Comments (2)

Moof on Feb. 16, 2006:

Having read the PEP, it also leaves one thing ambiguous, namely is:

from . import module

legal?

Kent Johnson on Feb. 16, 2006:

See http://docs.python.org/whatsnew/node10.html
Created: Feb. 15, 2006
Last Modified: Feb. 15, 2006
Author: jtauber