This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Lack of consistency in PEP 8 -- Style Guide for Python Code
Type: enhancement Stage:
Components: Documentation Versions: Python 3.3, Python 2.7
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: barry, docs@python, georg.brandl, gvanrossum, pauljurczak
Priority: normal Keywords:

Created on 2013-05-13 04:08 by pauljurczak, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (6)
msg189093 - (view) Author: Paul Jurczak (pauljurczak) Date: 2013-05-13 04:08
This may be too subjective, but here it goes:

PEP 8 discourages vertical alignment: "More than one space around an assignment (or other) operator to align it with another", but contrary to this rule, vertical alignment is used many times in the same paragraph, e.g.:
Yes: spam(1)
No:  spam (1)
If vertical alignment is so evil, the above should be changed to:
Yes: spam(1)
No: spam (1)

Disclosure: I use vertical alignment in my code quite often.

http://www.python.org/dev/peps/pep-0008/
msg189103 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2013-05-13 06:18
Interesting observation :)  However, the alignment in the PEP is in prose, not code.
msg189105 - (view) Author: Paul Jurczak (pauljurczak) Date: 2013-05-13 08:24
Correct, it is in mixed prose and code. However, the underlying principle in this PEP is: "guidelines provided here are intended to improve the readability of code". The author used vertical alignment (for mixed prose and code), because of its superior readability. Many others had found that aligning long columns of data improves readability, from newsprint and spreadsheets to multiple assignment statements.
msg189129 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2013-05-13 13:29
This is a silly argument.
msg189136 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2013-05-13 14:13
It's not *particularly* silly[1], but I think that with Government backing, he could make it very silly.

[1] I mean, the right hand side isn't silly at all and the left hand side merely does a forward aerial half turn every alternative assignment.
msg189158 - (view) Author: Paul Jurczak (pauljurczak) Date: 2013-05-13 18:03
I admit, it is somewhat silly, but not entirely silly.
History
Date User Action Args
2022-04-11 14:57:45adminsetgithub: 62166
2013-05-13 18:03:09pauljurczaksetmessages: + msg189158
2013-05-13 14:13:30barrysetmessages: + msg189136
2013-05-13 14:08:16barrysetnosy: + barry
2013-05-13 13:29:39gvanrossumsetstatus: open -> closed
resolution: not a bug
messages: + msg189129
2013-05-13 10:09:13pitrousetnosy: + gvanrossum
2013-05-13 08:24:58pauljurczaksetmessages: + msg189105
2013-05-13 06:18:47georg.brandlsetassignee: docs@python ->

messages: + msg189103
nosy: + georg.brandl
2013-05-13 04:08:36pauljurczakcreate