PLAY PODCASTS
Exploring the New Features of Python 3.12
Episode 175

Exploring the New Features of Python 3.12

The Real Python Podcast · Real Python

October 6, 20231h 6m

Audio is streamed directly from the publisher (dts.podtrac.com) as published in their RSS feed. Play Podcasts does not host this file. Rights-holders can request removal through the copyright & takedown page.

Show Notes

<p>Python 3.12 is here! Our regular guests, Geir Arne Hjelle and Christopher Trudeau, return to discuss the new version. Geir Arne coordinated a series of preview articles with several members of the Real Python team this year, and his showcase tutorial, &ldquo;Python 3.12: Cool New Features for You to Try,&rdquo; came out on October 2. Christopher&rsquo;s video course was posted the next day, covering the topics from the article with visual examples of Python 3.12 in action.</p> <p>Geir Arne and Christopher collaborated to create code examples of the new features. We discuss better error messaging, more intuitive f-strings, subinterpreters, the Linux <code>perf</code> profiler, improved typing syntax, and more.</p> <p>We dig into the updates and offer advice on incorporating them into your projects. We also consider when you should start running Python 3.12.</p> <div class="alert alert-primary" role="alert"> <p><strong>Course Spotlight:</strong> <a href="https://realpython.com/courses/new-features-python-312/">What&rsquo;s New in Python 3.12</a></p> <p>In this video course, you&rsquo;ll explore the new features that Python 3.12 brings to the table. These include improved f-strings, better error messages, changes to CPython internals, additions to static typing, and more.</p> </div> <p>Topics:</p> <ul> <li>00:00:00 &ndash; Introduction</li> <li>00:02:15 &ndash; Preview tutorials</li> <li>00:05:08 &ndash; Ever better error messages</li> <li>00:10:03 &ndash; More powerful f-strings</li> <li>00:15:46 &ndash; Comprehension inlining &amp; additional optimizations</li> <li>00:21:24 &ndash; Support for subinterpreters</li> <li>00:27:55 &ndash; Support for the Linux <code>perf</code> profiler</li> <li>00:32:02 &ndash; Immortal objects</li> <li>00:35:01 &ndash; Video Course Spotlight</li> <li>00:36:03 &ndash; Calendar constants for days and months</li> <li>00:38:48 &ndash; New <code>itertools.batched()</code> for grouping Items</li> <li>00:40:53 &ndash; Improved type variable syntax</li> <li>00:50:51 &ndash; New <code>Path.walk()</code> for listing files in subdirectories</li> <li>00:53:04 &ndash; Override decorator for static typing</li> <li>00:57:36 &ndash; Advice on upgrading</li> <li>01:03:08 &ndash; Thanks to the core developer team</li> <li>01:04:39 &ndash; Thanks to the Real Python team and goodbye</li> </ul> <p>Show Links:</p> <ul> <li><a href="https://realpython.com/python312-new-features/">Python 3.12: Cool New Features for You to Try</a></li> <li><a href="https://www.python.org/downloads/release/python-3120/">Python Release Python 3.12.0 - Python.org</a></li> <li><a href="https://realpython.com/python312-error-messages/">Python 3.12 Preview: Ever Better Error Messages</a></li> <li><a href="https://realpython.com/python312-f-strings/">Python 3.12 Preview: More Intuitive and Consistent F-Strings</a></li> <li><a href="https://peps.python.org/pep-0701/">PEP 701 – Syntactic formalization of f-strings</a></li> <li><a href="https://peps.python.org/pep-0709/">PEP 709 – Inlined comprehensions</a></li> <li><a href="https://realpython.com/python312-subinterpreters/">Python 3.12 Preview: Subinterpreters</a></li> <li><a href="https://peps.python.org/pep-0554/">PEP 554 – Multiple Interpreters in the Stdlib</a></li> <li><a href="https://peps.python.org/pep-0684/">PEP 684 – A Per-Interpreter GIL</a></li> <li><a href="https://realpython.com/python312-perf-profiler/">Python 3.12 Preview: Support For the Linux perf Profiler</a></li> <li><a href="https://peps.python.org/pep-0683/">PEP 683 – Immortal Objects, Using a Fixed Refcount</a></li> <li><a href="https://peps.python.org/pep-0695/">PEP 695 – Type Parameter Syntax</a></li> <li><a href="https://realpython.com/python312-typing/">Python 3.12 Preview: Static Typing Improvements</a></li> <li><a href="https://peps.python.org/pep-0698/">PEP 698 – Override Decorator for Static Typing</a></li> </ul> <p>Level up your Python skills with our expert-led courses:</p> <ul> <li><a href="https://realpython.com/courses/python-type-checking/">Python Type Checking</a></li> <li><a href="https://realpython.com/courses/new-features-python-312/">What&#x27;s New in Python 3.12</a></li> <li><a href="https://realpython.com/courses/new-features-python-311/">Cool New Features in Python 3.11</a></li> </ul> <p><a rel="payment" href="https://realpython.com/join">Support the podcast &amp; join our community of Pythonistas</a></p>