Juha-Matti Santala
Community Builder. Dreamer. Adventurer.

P is for Python Enhancement Proposal (PEP) - Python A to Z

Code in this blog post was written with versions: Python: 3.14

Python A-Z is a blog series about Python. Each day, I share insights, ideas and examples for different parts of Python development that match with the letter of the day. Blaugust is an annual blogging festival in August where the goal is to write a blog post every day of the month.

PEP stands for Python Enhancement Proposal. 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. - PEP 1 – PEP Purpose and Guidelines

If you’re a developer, you should start reading PEPs (or equivalents proposals in your language if such exist). They are a wonderful lesson in writing proposals for changes in software, having discussions in good faith between people who have differing opinions and arguing for your viewpoint and recording those discussions into decisions. In your own work or hobby project, this might be done in a form of an architecture decision record (ADR).

My favourite PEPs are a triplet PEP 634 – Structural Pattern Matching: Specification, PEP 635 – Structural Pattern Matching: Motivation and Rationale and PEP 636 – Structural Pattern Matching: Tutorial that defined the pattern matching mechanism that I like a lot.

A PEP starts with a metadata that shows who has authored it, when, what is its status and where you can find the discussion.

Author:
    Tobias Kohn <kohnt at tobiaskohn.ch>, Guido van Rossum <guido at python.org>
BDFL-Delegate:
Discussions-To:
    Python-Dev list
Status:
    Final
Type:
    Informational
Created:
    12-Sep-2020
Python-Version:
    3.10
Post-History:
    22-Oct-2020, 08-Feb-2021
Resolution:
    Python-Committers message 

Then, it goes through the motivation for this proposal, rationale, history and context, technical considerations like backwards compatibility and security concerns and a few additional things like references and copyright statement.

These days, the discussion about PEPs happen in Python’s official discussion forum. It’s a joy to read through to see bright minds discuss both the technical and the human side of these proposed changes.

I don’t think I’ll ever be involved in any PEP writing, discussion or decision making. I still enjoy reading them and following their development because it makes me better at arguing for and supporting my ideas and writing better documentation for decisions that have been made.

I encourage you to do the same!


If something above resonated with you, let's start a discussion about it! Email me at juhis@hamatti.org and share your thoughts. This year, I want to have more deeper discussions with people from around the world and I'd love if you'd be part of that.