Skip to content
Tech News
← Back to articles

Python 3.15: features that didn't make the headlines

read original more articles
Why This Matters

Python 3.15 introduces subtle yet impactful features like graceful cancellation of asyncio TaskGroups, enhancing structured concurrency and error handling. These improvements streamline asynchronous programming, making Python more robust and developer-friendly, which benefits both the industry and end-users by enabling more reliable and maintainable code.

Key Takeaways

Published: Wed 13 May 2026 In Blog. tags: Python Python3.15

It's that time of the year again, a new version of Python is just around the corner. With the Python 3.15.0b1 feature freeze, we know what's coming to Python later this year. There are so many big features coming including lazy imports and the tachyon profiler which I previously covered.

Last year, I really enjoyed investigating the smaller features of Python 3.14. I found that many of those features were just as interesting as the big PEPs and deserve a lot more attention. This year the situation is no different.

Asyncio Taskgroup Cancellation

There are not many Asyncio changes in this releases. The main feature to come out here is the ability to cancel a TaskGroup gracefully.

TaskGroup is a form of structured concurrency, it enables developers to create multiple concurrent tasks in a clean way.

async with asyncio . TaskGroup () as tg : tg . create_task ( run ()) tg . create_task ( run ()) # Waits for all the tasks to complete

Suppose we want to wait in the background for a signal of sorts to interrupt the taskgroup's execution, it's seems like something simple to do in asyncio, but in reality it's somewhat awkward to do this.

class Interrupt ( Exception ): ... with suppress ( Interrupt ): async with asyncio . TaskGroup () as tg : tg . create_task ( run ()) tg . create_task ( run ()) if await wait_for_signal (): raise Interrupt ()

This works because exceptions raised within a task group cause other tasks to cancel. The custom Interrupt exception is raised as part of a ExceptionGroup which then gets filtered by contextlib.suppress, resulting in a graceful exit.

... continue reading