Loose Ends and New Python Features

Tidying up

Author

Karsten Naert

Published

October 20, 2026

Finishing up exercises

Have you done all the exercises yet?

Repetitio est mater studiorum.

Groepswerk

…

Keeping up with new Python versions

Python gets a new feature release every year, in October, and each release is supported with bugfixes and security updates for five years after that. Knowing roughly what changed is part of the job: it is how you avoid writing 2015-era Python in 2026.

  • Python 3.14 was released in October 2025. Release notes are here.
  • Python 3.15 is expected in October 2026. Its (still moving) release notes are here.
Exercise

Install the most recent Python version alongside the one you are already using. With uv this is a one-liner:

uv python install 3.14
uv run --python 3.14 python -c "import sys; print(sys.version)"
Exercise

Look up for how long your Python version will be supported with bugfixes, and for how long with security updates. The official schedule has a handy diagram.

PEPs

PEP stands for Python Enhancement Proposal. It is the document in which someone argues for a change to the language, and it is where the discussion happens. Once a proposal is accepted, it may become part of the language.

The PEPs are numbered and freely readable at peps.python.org. They are also surprisingly good reading: a well-written PEP explains not just what the new feature is, but why the alternatives were rejected. Whenever you meet a feature in these notes with a PEP number attached, that PEP is the primary source.

A few highlights from 3.14

Template strings (PEP 750) look like f-strings but with a t prefix. The difference is that an f-string is evaluated immediately into a str, whereas a t-string gives you back an object that still knows which parts were literal text and which parts were substituted values. That distinction is what lets a library escape the substituted values correctly, so this is the beginning of a proper answer to SQL injection and HTML injection in Python.

Deferred evaluation of annotations (PEP 649/749) means type annotations are no longer evaluated when the function is defined, but only when something actually asks for them. This quietly fixes a long-standing set of forward-reference headaches. We come back to it in the lecture on type checkers.

Free-threaded Python (PEP 779) is now an officially supported build. This is the version without the Global Interpreter Lock, which means threads can genuinely run Python code in parallel. We discuss what that means in the lectures on processes and threads.

Exercise

Read the release notes of Python 3.14 and PEP 750. What can a template string do that an f-string cannot? Try writing a small function that takes a template string and returns HTML with the substituted values escaped.

Exercise

Browse the “What’s new” page of the upcoming Python 3.15. Pick one change that you think will matter for your own code and be ready to explain it in two minutes.