Python Best Practices

Chapter 1 · Practice 1 of 5

Run a Python version that still gets bug fixes

From Versions, environments and project setup

Why it matters

Every Python feature release gets about two years of bug fixes and then security fixes only, until it reaches end of life five years after release. Running an end-of-life version means security bugs in the interpreter and the standard library stay open.

BranchStatus in October 2026End of life
3.15Bug fixes (3.15.0 released October 9, 2026)October 2031
3.14Bug fixes (latest 3.14.8)October 2030
3.13, 3.12Security fixes only2029, 2028
3.11Security fixes onlyOctober 2027

For a new service, start on 3.14, which has a year of patch releases behind it, or on 3.15 once your key dependencies publish wheels for it. Libraries should test against every version still supported.

Check the status of Python versions page before you start a project, not only when something breaks.

Do

  • Pin the interpreter version in CI and in your container base image
  • Test libraries against every supported branch
  • Plan upgrades before a branch reaches end of life