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: Many PEP 8 errors
Type: Stage:
Components: Versions: Python 3.3, Python 2.7
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: Nosy List: benjamin.peterson, loewis, rhettinger, skreft
Priority: normal Keywords:

Created on 2011-11-07 03:03 by skreft, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (6)
msg147197 - (view) Author: (skreft) Date: 2011-11-07 03:03
Hi all, I was reading Python's source code and was surprised to find many PEP 8 errors.

The file that I found specially non PEP8 compliant is Lib/encodings/punnycode.py, but there are many others that are not compliant.

I think that this issue should be addressed, since Python's source code should be the model for good Pythonic code.

I would love to contribute on this topic. But since many files would be modified I don't know how to proceed. I see two things that could help to reduce the non compliance of the code. One is to have a website showing the non compliances of each file. And the one I like the most is to have a special test that checks the compliance of the code. The only problem is that it would rely on the external tool pep8 (http://pypi.python.org/pypi/pep8).

Let me know what you think.

Sebastian
msg147198 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2011-11-07 03:08
Generally, we don't do style cleanups for the sake of style cleanups.
msg147202 - (view) Author: (skreft) Date: 2011-11-07 05:22
Hi all again:

in the original posting of this issue,  I asked what would be the best way to address this issue. Additionally I proposed to use existing tools to check the current code. These tools could be easily added to the tests in a non failing mode, so developers who modify the code, could know that the source code does not follow the coding style and probably she/he could improve the code. This tool would also help newcomers to contribute better code.

Unfortunately, by the decision of rejecting this issue without even answering the full issue, I conclude that the Python team is not willing to improve its own basecode.

I repeat my posture, python source code should be a model of a python project, hence if there are tools that can ensure or improve the quality of the project, they should be incorporated to the development process.
msg147203 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2011-11-07 05:53
I concur with Benjamin.

This is a waste of time and a potential source of new errors.
msg147207 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2011-11-07 07:39
skreft: I can see nothing wrong by having a website that lists PEP 8 violations in the standard library - feel free to create one on wiki.python.org.

Your preferred solution of having automated tests is not feasible. Taking punycode.py (sic) as an example (of which I'm the author): I disagree with some of the warnings that the tool produces (and hence I probably disagree with parts of PEP 8 also). The warnings I agree with (about missing space characters), I also agree with Benjamin and Raymond: we shouldn't fix these in the code, since that would clutter the version history of the file (suggesting that it was modified when there wasn't any substantial change). The same reasoning probably applies to many other "violations".

When you said that punycode.py violates PEP 8, I was concerned. Then seeing the actual complaints of the tool make me laugh, since they are *really* micrological, when I was expecting substantial problems.
msg147220 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2011-11-07 13:54
2011/11/7 skreft <report@bugs.python.org>:
>
> skreft <skreft@gmail.com> added the comment:
>
> Hi all again:
>
> in the original posting of this issue,  I asked what would be the best way to address this issue. Additionally I proposed to use existing tools to check the current code. These tools could be easily added to the tests in a non failing mode, so developers who modify the code, could know that the source code does not follow the coding style and probably she/he could improve the code. This tool would also help newcomers to contribute better code.
>
> Unfortunately, by the decision of rejecting this issue without even answering the full issue, I conclude that the Python team is not willing to improve its own basecode.
>
> I repeat my posture, python source code should be a model of a python project, hence if there are tools that can ensure or improve the quality of the project, they should be incorporated to the development process.

It can be cleaned up and modernized as it is changed for some other
purpose. Ultimately, it doesn't matter in the least bit how many lines
are between inline comments and other code, which seems to be
principally what pep8.py cares about in Lib/*.
History
Date User Action Args
2022-04-11 14:57:23adminsetgithub: 57571
2011-11-07 13:54:58benjamin.petersonsetmessages: + msg147220
2011-11-07 07:39:05loewissetnosy: + loewis
messages: + msg147207
2011-11-07 05:53:35rhettingersetnosy: + rhettinger
messages: + msg147203
2011-11-07 05:22:33skreftsetmessages: + msg147202
2011-11-07 03:08:25benjamin.petersonsetstatus: open -> closed

nosy: + benjamin.peterson
messages: + msg147198

resolution: rejected
2011-11-07 03:03:50skreftcreate