Episode 131: Exploring the New Features of Python 3.11
The Real Python Podcast
Nov 04, 2022 1h 2m
Python 3.11 is here! Our regular guests, Geir Arne Hjelle and Christopher Trudeau, return to talk about the new version. Geir Arne wrote a series of preview tutorials earlier this year, and his annual piece, titled “Python 3.11: Cool New Features for You to Try,” was published on October 24. Christopher’s video course came out the next day, covering the topics from the tutorial with visual examples of Python 3.11 in action.
Geir Arne and Christopher collaborated to create code examples for the new features. We discuss better error messages, faster code execution, task and exception groups, typing features, and native TOML support.
We dive into the updates and offer advice about ways to incorporate them into your projects. We also consider when you should start running Python 3.11.
Course Spotlight: Cool New Features in Python 3.11 – Real Python
In this video course, you’ll explore what Python 3.11 brings to the table. You’ll learn how Python 3.11 is the fastest and most user-friendly version of CPython yet, and learn about improvements to the typing system and to the asynchronous features of Python.
Topics:
- 00:00:00 – Introduction
- 00:02:19 – Preview series
- 00:03:50 – Faster CPython project
- 00:07:10 – Specializing adaptive interpreter
- 00:11:24 – Other performance stuff
- 00:16:07 – Sponsor: Deepgram
- 00:16:51 – Improved tracebacks
- 00:21:49 – Exception groups and notes
- 00:27:22 – Self type and additional type hints
- 00:36:14 – Video Course Spotlight
- 00:37:27 – asyncio and task groups
- 00:41:25 – TOML and tomllib
- 00:46:21 – ISO date parsing
- 00:50:09 – Negative zeros
- 00:53:38 – Dead battery deprecations
- 00:56:04 – Advice on upgrading
- 01:01:01 – Thanks and goodbye
Show Links:
- Python 3.11: Cool New Features for You to Try – Real Python
- Cool New Features in Python 3.11 – Video Course
- faster-cpython/plan.md - GitHub
- PEP 659 – Specializing Adaptive Interpreter - peps.python.org
- Just-in-time compilation - Wikipedia
- Episode #381 Python Perf: Specializing, Adaptive Interpreter - Talk Python To Me Podcast
- Episode #339 Making Python Faster with Guido and Mark - Talk Python To Me Podcast
- “Zero cost” exception handling · Issue #84403 · python/cpython - GitHub
- Python 3.11 Preview: Task and Exception Groups – Real Python
- Faster Startup In Python 3.11 — Python 3.11.0 documentation
- Python 3.11 Preview: Even Better Error Messages – Real Python
- PEP 657 – Include Fine Grained Error Locations in Tracebacks - peps.python.org
- Episode #105: Creating Better Error Messages for Python 3.10 & 3.11 – The Real Python Podcast
- Exception Groups and except: Irit Katriel - YouTube
- PEP 673 – Self Type - peps.python.org
- PEP 646 – Variadic Generics - peps.python.org
- How Exception Groups Will Improve Error Handling in AsyncIO - Łukasz Langa | Power IT Conference - YouTube
- Neopythonic: Reasoning about asyncio.Semaphore
- PEP 680 – tomllib: Support for Parsing TOML in the Standard Library - peps.python.org
- TOML: Tom’s Obvious Minimal Language
- Python 3.11 Preview: TOML and tomllib – Real Python
- datetime — Basic date and time types — Python 3.11.0 documentation
- 13 Month Calendar
- Signed zero - Wikipedia
- PEP 594 – Removing dead batteries from the standard library - peps.python.org