from __future__ import absolute_import ?

Peter Otten __peter__ at web.de
Fri Feb 2 12:25:49 EST 2007


Peter Otten wrote:

> If there are two modules 'foo', one at the toplevel and the other inside a
> package 'bar',
> 
> from __future__ import absolute_import
> import foo
> 
> will import the toplevel module whereas
> 
> import foo
> 
> will import bar.foo. 

... provided these imports are performed from modules within 'bar'.

Peter



More information about the Python-list mailing list