<br><br><div class="gmail_quote">On Fri, Jul 8, 2011 at 06:51, Sylvain Thénault <span dir="ltr"><<a href="mailto:sylvain.thenault@logilab.fr">sylvain.thenault@logilab.fr</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi there,<br>
<br>
the documentation state that absolute_import feature is the default<br>
behaviour with python 2.7, though it seems that it behave differently<br>
with the __future__ import :<br>
<br>
$ cat package/__init__.py<br>
<br>
import subpackage<br>
<br>
$ python2.7<br>
Python 2.7.1+ (default, Apr 20 2011, 22:33:39)<br>
[GCC 4.5.2] on linux2<br>
Type "help", "copyright", "credits" or "license" for more information.<br>
>>> import package<br>
>>><br>
<br>
$ cat package/__init__.py<br>
<br>
from __future__ import absolute_import<br>
import subpackage<br>
<br>
$ python2.7<br>
Python 2.7.1+ (default, Apr 20 2011, 22:33:39)<br>
[GCC 4.5.2] on linux2<br>
Type "help", "copyright", "credits" or "license" for more information.<br>
>>> import package<br>
Traceback (most recent call last):<br>
File "<stdin>", line 1, in <module><br>
File "package/__init__.py", line 23, in <module><br>
import subpackage<br>
ImportError: No module named subpackage<br></blockquote><div><br></div><div>So are you claiming that the import of 'package' w/o the __future__ statement actually succeeds even though there is no package.subpackage module? Obviously that would be a flat-out bug, but I just double-checked my sanity and that does nto work with a CPython 2.7 checkout. </div>
</div>