Trying to go from a script kiddie to a semi-respectable software engineer and need to learn how to write clean, digestible code. The book I'm reading pointed me towards PEP 8 - I know this is the foundational styling guide for Python.
What I can't seem to figure out is if all the guidelines are still valid today in 2022 and nothing has changed since its last update in 2013 OR if there are supplemental PEPs I should be reading.
Visited https://peps.python.org/pep-0000/ and started browsing through the different releases but got confused and unsure which PEPs besides 8 have to do with style guidelines.
I found this previous question from 9 years ago and wanted to see if any of the answers have changed.
CodePudding user response:
At the top, below the authors, you can see it says
Status: Active
As the tooltip explains, that means PEP 8 is
Currently valid informational guidance, or an in-use process
If the PEP is ever replaced it will say "Status: Superseded".
At the bottom of the page it says:
Last modified: 2022-05-11 17:45:05 GMT
You can check the link to see what changes have been made to PEP 8 when.
CodePudding user response:
Quoting from the official Python documentation which was last updated on Jan 13, 2023 (as of writing, and is kept pretty well up-to-date):
Are there coding standards or a style guide for Python programs?
Yes. The coding style required for standard library modules is documented as PEP 8.
No mention of anything that would take priority over PEP 8. There are other style guidelines written by third parties, but PEP 8 is still the official style guide.
CodePudding user response:
PEP 8 is still the latest and great official recommendation, as indicated by the PEP not having any notice that it’s been deprecated or superseded.
There are some alternatives that are stricter than PEP 8, including Black and YAPF