Absolute imports?

Chris Angelico rosuav at gmail.com
Sat Feb 15 10:26:13 EST 2014


On Sun, Feb 16, 2014 at 2:06 AM, Roy Smith <roy at panix.com> wrote:
> It also says, "This absolute-import behaviour will become the default in
> a future version (probably Python 2.7)", but it appears that 2.7.6 is
> still doing relative by default.
>

Since absolute imports can be controlled with a future directive, you
can check it out via that module:

>>> import __future__
>>> __future__.absolute_import
_Feature((2, 5, 0, 'alpha', 1), (3, 0, 0, 'alpha', 0), 16384)

Looks like it was held over for 3.0 rather than potentially breaking
stuff across 2.6->2.7.

ChrisA



More information about the Python-list mailing list