[issue23447] Relative imports with __all__ attribute

2015-02-12 Thread Steven Barker
Steven Barker added the comment: This issue is a special case of the problem discussed in issue 992389, that modules within packages are not added to the package dictionary until they are fully loaded, which breaks circular imports in the form "from package import module". The consensus on th

[issue23447] Relative imports with __all__ attribute

2015-02-12 Thread Antonio Cota
Changes by Antonio Cota : -- versions: -Python 3.4 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue23447] Relative imports with __all__ attribute

2015-02-12 Thread Antonio Cota
Antonio Cota added the comment: I tried the following on python 3.5.0a1: #init.py __all__ = ['second', 'first'] print('i\'m starting the directory') #first.py print('hi, i\'m the first') from . import second #second.py print('hi, i\'m the second') from . import first >>> import a.first i'm st

[issue23447] Relative imports with __all__ attribute

2015-02-12 Thread Brett Cannon
Brett Cannon added the comment: If you put a print call after your `from . import *` call you will notice it never gets executed. Basically import is still in the middle of finishing imports when that import * is reached, including setting the module attributes on the package. Basically you ha

[issue23447] Relative imports with __all__ attribute

2015-02-11 Thread Antonio Cota
Changes by Antonio Cota : -- versions: +Python 3.4 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail

[issue23447] Relative imports with __all__ attribute

2015-02-11 Thread Antonio Cota
New submission from Antonio Cota: That's the situation: a/ __init__.py first.py second.py #init.py __all__ = ['second', 'first'] print('i\'m starting the directory') #first.py print('hi, i\'m the first') from . import * #second.py print('hi, i\'m the second') >From the interactive prom