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: PEP 8 code format
Type: enhancement Stage: resolved
Components: Versions:
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: ZhiyuanChen, serhiy.storchaka, steven.daprano
Priority: normal Keywords:

Created on 2021-12-17 09:18 by ZhiyuanChen, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
onelineif.txt ZhiyuanChen, 2021-12-17 09:17
Messages (3)
msg408761 - (view) Author: Zhiyuan Chen (ZhiyuanChen) * Date: 2021-12-17 09:17
Current cpython code base still contains a massive amount of code that is not complied with the PEP-8 formatting. 
For example, there are 553 one line if statement (`if xxx: yyy`) in the current codebase.
msg408763 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2021-12-17 09:33
PEP 8 is a guide for writing new code. It does not require rewriting the old code. In fact, patches with mass reformatting of the stdlib code have always been rejected.
msg408769 - (view) Author: Steven D'Aprano (steven.daprano) * (Python committer) Date: 2021-12-17 10:50
> not complied with the PEP-8 formatting.

PEP 8 says:

"Some other good reasons to ignore a particular guideline:

3. Because the code in question predates the introduction of the guideline and there is no other reason to be modifying that code."

So PEP 8 itself tells us that legacy code that ignores the style guidelines is already compliant with PEP 8.
History
Date User Action Args
2022-04-11 14:59:53adminsetgithub: 90270
2021-12-17 10:50:22steven.dapranosetnosy: + steven.daprano
messages: + msg408769
2021-12-17 09:33:06serhiy.storchakasetstatus: open -> closed

nosy: + serhiy.storchaka
messages: + msg408763

resolution: not a bug
stage: resolved
2021-12-17 09:18:00ZhiyuanChencreate