On Fri, Jul 8, 2011 at 06:51, Sylvain Thénault <sylvain.thena...@logilab.fr>wrote:
> Hi there, > > the documentation state that absolute_import feature is the default > behaviour with python 2.7, though it seems that it behave differently > with the __future__ import : > > $ cat package/__init__.py > > import subpackage > > $ python2.7 > Python 2.7.1+ (default, Apr 20 2011, 22:33:39) > [GCC 4.5.2] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> import package > >>> > > $ cat package/__init__.py > > from __future__ import absolute_import > import subpackage > > $ python2.7 > Python 2.7.1+ (default, Apr 20 2011, 22:33:39) > [GCC 4.5.2] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> import package > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > File "package/__init__.py", line 23, in <module> > import subpackage > ImportError: No module named subpackage > 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.
_______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com