PLAY PODCASTS
Using an Ellipsis in Python & Goals for CPython 3.12
Episode 129

Using an Ellipsis in Python & Goals for CPython 3.12

The Real Python Podcast · Real Python

October 14, 202256m 44s

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>Where should you use an ellipsis in Python? How does it behave as a placeholder in a script, project, or stub file? What are the next goals for the Faster CPython project? This week on the show, Christopher Trudeau is here, bringing another batch of PyCoder&rsquo;s Weekly articles and projects.</p> <p>We talk about a Real Python article that covers when you should use an ellipsis in Python. We discuss the similarities with the <code>pass</code> keyword and how it&rsquo;s used for type hints within stub files. </p> <p>Christopher shares resources covering the goals of the Faster CPython project. We&rsquo;re on the cusp of the release of Python 3.11, but the project keeps moving forward as they look at ways to continue speeding up Python. </p> <p>We share several other articles and projects from the Python community, including a news roundup, alternatives for hosting Python-based applications, ways to create custom Python strings, a discussion about aging programmers, a structural diff that understands syntax, and a project for refurbishing and modernizing Python codebases.</p> <div class="alert alert-primary" role="alert"> <p><strong>Course Spotlight:</strong> <a href="https://realpython.com/courses/multiple-constructors-python/">Providing Multiple Constructors in Your Python Classes</a></p> <p>In this video course, you&rsquo;ll learn how to provide multiple constructors in your Python classes. To this end, you&rsquo;ll learn different techniques, such as checking argument types, using default argument values, writing class methods, and implementing single-dispatch methods.</p> </div> <p>Topics:</p> <ul> <li>00:00:00 &ndash; Introduction</li> <li>00:02:26 &ndash; Django security releases issued</li> <li>00:02:44 &ndash; PEP 698: Override Decorator for Static Typing</li> <li>00:03:37 &ndash; Heroku Alternatives for Python-Based Applications</li> <li>00:14:34 &ndash; Python 3.12 Goals: Faster-CPython Ideas Wiki</li> <li>00:20:29 &ndash; Sponsor: InfluxDB</li> <li>00:21:19 &ndash; When Do You Use an Ellipsis in Python?</li> <li>00:28:18 &ndash; Custom Python Strings: Inheriting From <code>str</code> vs <code>UserString</code></li> <li>00:32:52 &ndash; Aging Programmer</li> <li>00:46:32 &ndash; Video Course Spotlight</li> <li>00:47:48 &ndash; difftastic: A Structural Diff That Understands Syntax</li> <li>00:50:44 &ndash; refurb: Refurbish and Modernize Python Codebases</li> <li>00:55:44 &ndash; Thanks and goodbye</li> </ul> <p>News:</p> <ul> <li><a href="https://www.djangoproject.com/weblog/2022/oct/04/security-releases/">Django security releases issued: 4.1.2, 4.0.8, and 3.2.16 | Weblog | Django</a></li> <li><a href="https://peps.python.org/pep-0698/">PEP 698: Override Decorator for Static Typing</a> &ndash; This Python Enhancement Proposal describes the use of a new decorator, <code>@override</code>, which would be used as a type hint for methods in a subclass that override a parent&rsquo;s method. This type hint would introduce a level of safety if the parent method is refactored without corresponding changes to the child method.</li> </ul> <p>Show Links:</p> <ul> <li><a href="https://testdriven.io/blog/heroku-alternatives/">Heroku Alternatives for Python-Based Applications</a> &ndash; Learn about alternatives to Heroku and their pros and cons. Platforms discussed include Digital Ocean, Google App Engine, AWS, Azure, PythonAnywhere, and half a dozen more.</li> <li><a href="https://github.com/faster-cpython/ideas/wiki/Python-3.12-Goals">Python 3.12 Goals: Faster-CPython Ideas Wiki</a> &ndash; A summary of the goals for the Faster CPython initiative within the Python 3.12 release. Includes trace optimizations, shrinking object sizes, improving memory management overhead, and more. See also the associated <a href="https://github.com/faster-cpython/ideas/wiki/Workflow-for-3.12-cycle">Workflow for 3.12 cycle</a> checklist.</li> <li><a href="https://realpython.com/python-ellipsis/">When Do You Use an Ellipsis in Python?</a> &ndash; You may have seen three dots in Python scripts. Although this syntax may look odd, using an ellipsis is valid Python code. In this tutorial, you&rsquo;ll learn when Python&rsquo;s <code>Ellipsis</code> constant can come in handy for you.</li> <li><a href="https://realpython.com/inherit-python-str/">Custom Python Strings: Inheriting From <code>str</code> vs <code>UserString</code></a> &ndash; In this tutorial, you&rsquo;ll learn how to create custom string-like classes in Python by inheriting from the built-in <code>str</code> class or by subclassing <code>UserString</code> from the <code>collections</code> module.</li> </ul> <p>Discussion:</p> <ul> <li><a href="https://news.ycombinator.com/item?id=32961933">Aging Programmer</a></li> </ul> <p>Projects:</p> <ul> <li><a href="https://github.com/wilfred/difftastic">difftastic: A Structural Diff That Understands Syntax</a></li> <li><a href="https://github.com/dosisod/refurb">refurb: Refurbish and Modernize Python Codebases</a></li> </ul> <p>Additional Links:</p> <ul> <li><a href="https://www.opalstack.com/">Opalstack</a></li> <li><a href="https://pypi.org/project/cookiecutter-python/">cookiecutter-python · PyPI</a></li> <li><a href="https://github.com/python/typeshed/tree/master/stubs">typeshed/stubs at master · python/typeshed</a></li> <li><a href="https://blog.codinghorror.com/why-cant-programmers-program/">Why Can&rsquo;t Programmers.. Program?</a></li> </ul> <p>Level up your Python skills with our expert-led courses:</p> <ul> <li><a href="https://realpython.com/courses/rest-apis-with-django-ninja/">Sneaky REST APIs With Django Ninja</a></li> <li><a href="https://realpython.com/courses/multiple-constructors-python/">Using Multiple Constructors in Your Python Classes</a></li> <li><a href="https://realpython.com/courses/using-python-class-constructors/">Using Python Class Constructors</a></li> </ul> <p><a rel="payment" href="https://realpython.com/join">Support the podcast &amp; join our community of Pythonistas</a></p>