Issue 27187: Relax all location requirement in PEP 8 (original) (raw)

Created on 2016-06-02 21:06 by barry, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue-27187-patch1.txt IanLee1521,2016-06-03 00:20
issue-27187-patch2.txt IanLee1521,2016-06-03 00:44 Updated patch that removes version bookkeeping section
issue-27187-patch3.txt IanLee1521,2016-06-08 03:44 New patch explicitly mentioning ``__future__`` imports
Messages (9)
msg266949 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2016-06-02 21:06
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: https://github.com/PyCQA/pycodestyle/issues/394
msg267002 - (view) Author: Ian Lee (IanLee1521) * Date: 2016-06-03 00:20
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.
msg267008 - (view) Author: Ian Lee (IanLee1521) * Date: 2016-06-03 00:31
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.
msg267014 - (view) Author: Ian Lee (IanLee1521) * Date: 2016-06-03 00:59
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: https://github.com/PyCQA/pycodestyle/pull/523#issuecomment-223464775
msg267743 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-06-07 20:25
New changeset cf8e888b9555 by Barry Warsaw in branch 'default': Relax __all__ location. https://hg.python.org/peps/rev/cf8e888b9555
msg267744 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2016-06-07 20:26
Thanks for the patch!
msg267757 - (view) Author: John Mark Vandenberg (jayvdb) * Date: 2016-06-08 00:50
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?
msg267771 - (view) Author: Ian Lee (IanLee1521) * Date: 2016-06-08 03:44
Good catch. I'm uploading a new patch that addresses ``from __future__`` imports issue explicitly.
msg267859 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2016-06-08 14:34
Thanks Ian. I'm going to apply that, but rephrase it a bit.
History
Date User Action Args
2022-04-11 14:58:31 admin set github: 71374
2016-06-08 14:34:38 barry set messages: +
2016-06-08 03:44:54 IanLee1521 set files: + issue-27187-patch3.txt
2016-06-08 03:44:08 IanLee1521 set messages: +
2016-06-08 00:50:42 jayvdb set messages: +
2016-06-07 20:26:13 barry set messages: +
2016-06-07 20:25:26 python-dev set status: open -> closednosy: + python-devmessages: + resolution: fixedstage: resolved
2016-06-03 01:15:36 jayvdb set nosy: + jayvdb
2016-06-03 00:59:26 IanLee1521 set messages: +
2016-06-03 00:44:51 IanLee1521 set files: + issue-27187-patch2.txt
2016-06-03 00:31:10 IanLee1521 set messages: +
2016-06-03 00:20:06 IanLee1521 set files: + issue-27187-patch1.txtmessages: +
2016-06-02 21:14:06 IanLee1521 set nosy: + IanLee1521
2016-06-02 21:07:12 barry set assignee: docs@pythoncomponents: + Documentationnosy: + docs@python
2016-06-02 21:06:42 barry create