The Canon / R9 · root

Compatibility as a constraint

After Python 3, nothing may be broken. An implementation detail becomes a promise exactly when too much code has come to rely on it.

The only root without chapters of its own — because it is not a mechanism but the frame within which all the other decisions were made.

1What happened

Python 3 came out in 2008 and broke compatibility on purpose. There was one main reason, and it was the right one: strings and bytes had to be separated once and for all, and that was impossible to do without breakage. Along the way, division, printing, and iterators instead of lists in half of the built-in functions were fixed, and the standard library was put in order.

The migration took twelve years. Support for Python 2 ended in 2020; by then large projects had spent years moving, and some never moved at all. Tools for automatic conversion helped only partly — the semantics of str and bytes differed so much that the machine had to guess.

2What it taught

The conclusion the community drew and confirmed in practice: nothing may be broken again. Not “undesirable” — forbidden: the cost turned out to be out of all proportion to any benefit from a cleaner language.

Hence everything you see today:

3The main consequence for the reader

The last point is the most substantial, and it recurs throughout the canon. An implementation detail becomes a promise exactly when too much code has come to rely on it. Dictionary order went down that path within one release. Deterministic destruction by reference count has not gone down it and most likely never will — yet half of the code ever written relies on it.

That is why this canon's hardness scale is not pedantry but a working tool: it answers the question “will my code break on another implementation or in the next release?”, and at staff level that question is asked directly.

Written by · The Python Canon