You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Relax __all__ location requirement in PEP 8 #71374
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2016-06-07.20:25:26.839>created_at=<Date2016-06-02.21:06:42.006>labels= ['docs']
title='Relax __all__ location requirement in PEP 8'updated_at=<Date2016-06-08.14:34:38.652>user='https://github.com/warsaw'
I think that it should be updated to specify that all dunders ('__all__', '__version__', '__author__', etc) should be placed after the module docstring and before any imports. See issue-27187-patch1.txt for a possible update.
IanLee1521 commented on Jun 3, 2016
IanLee1521mannequin
Mannequin
More actions
I might also suggest that the entire "Version bookkeeping" section could be removed in this case, as it would be covered by my newly added dunder section.
IanLee1521 commented on Jun 3, 2016
IanLee1521mannequin
Mannequin
More actions
I added a comment on a pull request related to this that shows some of the cases that we probably don't want to allow: PyCQA/pycodestyle#523 (comment)
The revised text says __dunder__ should appear before any imports, however __future__ imports must appear first for obvious reasons. Does this need to be mentioned in the pep?
IanLee1521 commented on Jun 8, 2016
IanLee1521mannequin
Mannequin
More actions
Good catch.
I'm uploading a new patch that addresses from __future__ imports issue explicitly.
Activity
warsaw commentedon Jun 2, 2016
PEP-8 says:
Put any relevant __all__ specification after the imports.
I don't remember why we wanted __all__ to go after imports. I think we should relax that since other dunders can go before imports.
See related PYCQA issue: PyCQA/pycodestyle#394
IanLee1521 commentedon Jun 3, 2016
I think that it should be updated to specify that all dunders ('__all__', '__version__', '__author__', etc) should be placed after the module docstring and before any imports. See issue-27187-patch1.txt for a possible update.
IanLee1521 commentedon Jun 3, 2016
I might also suggest that the entire "Version bookkeeping" section could be removed in this case, as it would be covered by my newly added dunder section.
IanLee1521 commentedon Jun 3, 2016
I added a comment on a pull request related to this that shows some of the cases that we probably don't want to allow: PyCQA/pycodestyle#523 (comment)
python-dev commentedon Jun 7, 2016
New changeset cf8e888b9555 by Barry Warsaw in branch 'default':
Relax __all__ location.
https://hg.python.org/peps/rev/cf8e888b9555
warsaw commentedon Jun 7, 2016
Thanks for the patch!
jayvdb commentedon Jun 8, 2016
The revised text says __dunder__ should appear before any imports, however __future__ imports must appear first for obvious reasons. Does this need to be mentioned in the pep?
IanLee1521 commentedon Jun 8, 2016
Good catch.
I'm uploading a new patch that addresses
from __future__imports issue explicitly.warsaw commentedon Jun 8, 2016
Thanks Ian. I'm going to apply that, but rephrase it a bit.