Exploring the Latest Features of Python 3.12
summary
Concrete upgrades: generics use bracket syntax and the new type statement for cleaner aliases, TypedDict now appears in function signatures, and an override decorator enforces correct method overrides. F strings allow reused quotes, arbitrary nesting, comments and clearer error messages. Performance changes include up to 75% asyncio speedup, current_task moved to C for 4–6× faster task ops, comprehension inlining roughly 2× faster, per-interpreter GIL, immortal objects, itertools.batched and a low‑impact monitoring API.
AI-written summary · about
chapters (29)
- 0:00intro
- 0:20preamble
- 0:39typing improvements
- 1:21generics with new syntax
- 1:52typedict
- 2:37override decorator
- 3:10advanced type parameters
- 3:58type aliases
- 4:28lazy evaluation
- 5:03syntax improvements
- 5:45reusing quotes within f-strings
- 6:14arbitraty nesting of f-strings
- 6:33multi-line expressions and comments
- 7:02backlashes and unicode characters
- 7:21improved error messaging for f-strings
- 7:48itertools.batched
- 8:13performance
- 8:42asyncio performance enhancements
- 9:16boost in inspect and typing modules
- 9:52unique per interpreter gil
- 10:26comprehension inlining
- 11:12immortal objects
- 11:50buffer protocol
- 12:26other enhancements
- 12:50debugging
- 13:17improved nameerror suggestions
- 13:42syntax and importerror enhancements
- 14:07low impact monitoring
- 14:48resources & links
related talks
37mKeynote 1: What's New in Python
01h 00mKeynote: Python now and in the future
43mPython Improvements (or This Is Not Your Teacher's Python)
01h 22mWhat's New in Python 3
03h 40mTyping
29mHow we are making CPython faster. Past, present and future.
49mThe Evolution of Python: Progress or Dead End
42mOptimizing Code Performance for Python Internals
