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’s Weekly articles and projects.
We talk about a Real Python article that covers when you should use an ellipsis in Python. We discuss the similarities with the pass
keyword and how it’s used for type hints within stub files.
Christopher shares resources covering the goals of the Faster CPython project. We’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.
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.
Course Spotlight: Providing Multiple Constructors in Your Python Classes
In this video course, you’ll learn how to provide multiple constructors in your Python classes. To this end, you’ll learn different techniques, such as checking argument types, using default argument values, writing class methods, and implementing single-dispatch methods.
Topics:
str
vs UserString
News:
@override
, which would be used as a type hint for methods in a subclass that override a parent’s method. This type hint would introduce a level of safety if the parent method is refactored without corresponding changes to the child method.Show Links:
Ellipsis
constant can come in handy for you.str
vs UserString
– In this tutorial, you’ll learn how to create custom string-like classes in Python by inheriting from the built-in str
class or by subclassing UserString
from the collections
module.Discussion:
Projects:
Additional Links:
Level up your Python skills with our expert-led courses: