I used the abbreviation PEP in a few posts without every explaining what this is. It is now time for a closer look at the development process of the Python programming language.
This post is part of my journey to learn Python. You can find the other parts of this series here.
PEP?
The abbreviation PEP stands for Python Enhancement Proposal and means this:
A PEP is a design document providing information to the Python community, or describing a new feature for Python or its processes or environment. The PEP should provide a concise technical specification of the feature and a rationale for the feature.
We intend PEPs to be the primary mechanisms for proposing major new features, for collecting community input on an issue, and for documenting the design decisions that have gone into Python. The PEP author is responsible for building consensus within the community and documenting dissenting opinions.
Source: PEP-1
You can find the full list of PEPs at Python.org. Although a PEP is probably not the document you want to read to learn the basic use of a feature, they provide a lot of information about how and why.
Why should that interest me?
If you (like me) just want to program with Python and not Python itself, then those PEP may carry too many details to be helpful. However, I found some good explanations there that I did not find in the official documentation. Whenever you like details, the PEP to that topic will offer them.
This selection of PEPs I found helpful and used so far to get a better understanding on the topics I covered in Python Friday:
- PEP 8 — Style Guide for Python Code the one PEP you definitely should read, either in its official PEP format or the more user-friendly one by pep8.org.
- PEP 257 — Docstring Conventions contains all the semantics and conventions you can (and should) use to document your code.
- PEP 278 — Universal Newline Support shows how Python on each platform can read and import files with CR (Macintosh), LF (Unix) or CR LF (Windows) line endings.
- PEP 343 — The “with” Statement helps you to get rid of the try/finally blocks when working with files and other resources.
- PEP 498 — Literal String Interpolation brings you the nice syntax to format strings.
Conclusion
A Python Enhancement Proposal (PEP) describes a feature of the Python language in great technical detail. Most of the time you may not need to know all the details about a feature, but when you want, the PEP is the place to find it.