Expert Python Programming(Third Edition)
上QQ阅读APP看书,第一时间看更新

Being up-to-date with changes ­by following PEP documents

The Python community has a well-established way of dealing with changes. While speculative Python language ideas are mostly discussed on specific mailing lists (python-ideas@python.org), nothing major ever gets changed without the existence of a new document, called a Python Enhancement Proposal (PEP).

It is a formalized document that describes, in detail, the proposal of change to be made in Python. It is also the starting point for the community discussion. The whole purpose, format, and workflow around these documents is also standardized in the form of a PEPprecisely the PEP 1 document (http://www.python.org/dev/peps/pep-0001).

PEP documentation is very important for Python, and, depending on the topic, they serve different purposes:

  • Informing: They summarize the information needed by core Python developers, and notify about Python release schedules
  • Standardizing: They provide code style, documentation, or other guidelines
  • Designing: They describe the proposed features

A list of all proposed PEPs are available in a living PEP 0 document (https://www.python.org/dev/peps/). Since they are easily accessible in one place, and the actual URL is also very easy to guess, they are usually referred to by the number in the book.

The PEP 0 document is a great source of information for those who are wondering what direction Python language is heading in, but do not have time to track every discussion on Python mailing lists. It shows which documents were already accepted but not yet implemented, and also which are still under consideration.

PEPs also serve additional purposes. Very often, people ask questions like the following:

  • Why does feature A work that way?
  • Why does Python not have feature B?

In most such cases, the extensive answer is already available in specific PEP documents where such a feature was already mentioned. There is a lot of PEP documentation describing Python language features that were proposed but not accepted. This documentation is left as a historical reference.