Notes, Groups and Stars: exceptional new features of Python 3.11!
summary
Python 3.11 actually adds concrete error‑handling tools: add_note() annotations, hierarchical ExceptionGroup objects, and the new except syntax for selective handling. The talk demos tracebacks that pinpoint the failing subexpression, shows pytest fixture teardown and async task groups producing groups, and explains subgroup/split helpers and a proposed group.leaf_exceptions plus a context manager to preserve concise tracebacks. These features exist and help, but extracting single leaves without losing context remains fiddly and needs helper APIs/backports.
AI-written summary · about
chapters (13)
- 0:00Exception handling in Python
- 1:08Exceptions vs error returns
- 3:12Automatic exception propagation
- 4:14Python tracebacks
- 5:16Exception chaining and causes
- 7:02Modifying tracebacks
- 8:27Adding notes to exceptions
- 9:52Exception groups
- 13:28Except star syntax
- 15:35Handling exception groups
- 17:26Flattening exception groups
- 19:10Destructuring exception groups
- 19:54Q&A
related talks
26mMaking Python better one error message at a time
37mKeynote 1: What's New in Python
15mExploring the Latest Features of Python 3.12
31mIntroduce Syntax and History of Python from 2.4 to 3.6
43mPython Improvements (or This Is Not Your Teacher's Python)
11mUsing and abusing Python's logging module for more readable logs
42mKeynote - Steering Council Panel
01h 22mWhat's New in Python 3
