mailwal

πŸπŸš€ [3.15] 4 upgrades to the std library

Rodrigo | Mathspp

October 28, 2026

πŸπŸš€ [3.15] 4 upgrades to the std library

day 12 of 15 days of Python 3.15

Hey there, πŸ‘‹

How is your Python 🐍 going?

In this email we’ll talk about 4 improvements made to the standard library in 3.15. πŸš€

Python 3.15 logo. Purple heart in the background with two symmetrical snakes, yellow and blue, in front. Some release highlights frame the whole logo. Logo by Marie Nordin and Georgi Ker.

See the future schedule here and links to the previous days: https://mathspp.com/python-315

New object_hook in json.load

The new parameter can be set to a function.

This function runs whenever JSON loads a dictionary.

Use it with frozendict and array_hook=tuple to load JSON data as immutable:

import json

def load_immutable_json(filepath):
    with open(filepath, "r") as f:
        data = json.load(
            f,
            object_hook=frozendict,
            array_hook=tuple,
        )
    return data

New module math.integer

This new module has 6 functions that operate on integers and return integers:

  1. comb(n, k)

  2. perm(n, k=None)

  3. gcd(*integers)

  4. lcm(*integers)

  5. isqrt(n)

  6. factorial(n)

New re.prefixmatch function

This actually isn’t new functionality.

prefixmatch is exactly the same as match.

The problem is that match has a confusing name.

I always use it thinking it’s the same as re.search.

So, prefixmatch makes the behaviour more clear.

New code should use prefixmatch but match will be kept for backwards-compatibility.

New TaskGroup.cancel method

You can now cancel task groups (and all their tasks) with the method cancel.

Much more convenient than keeping track of all tasks manually and then cancelling each in turn.

Other exciting additions to the std library

Of course the std library got other exciting additions, but we covered many of them already:

Further reading

You can learn more about each new feature by reading the full article here: https://mathspp.com/blog/4-upgrades-to-the-python-standard-library-in-315

Tomorrow you’ll learn about the improvements made to iterators so they work with concurrency.

See the future schedule here and links to the previous days: https://mathspp.com/python-315

tw
yt
in

You received this email (at [subscriber]) because you got my free Python book β€œPydon’ts” or one of my other books/cheatsheets (or because you signed up directly!).

Rodrigo πŸπŸš€

Β© 2026 mathspp insider πŸπŸš€

228 Park Ave S, #29976, New York, New York 10003, United States