Besides the exciting free-threaded mode and Just-In-Time compiler, which has been discussed for a while in the Python community, what also attracts me is the new enhancements of the typing system.
Building on the robust typing system introduced in earlier versions, Python 3.13 is set to introduce seven new typing features that promise to enhance code reliability and developer productivity.
In this article, we’ll try these exciting new features and explore how they can streamline our code and elevate our programming practices to new heights.
All the code snippets in this article were tested on the latest release version, Python 3.13.0rc2, which is the final release preview for Python 3.13. The official release of 3.13.0 is scheduled for Tuesday, 2024–10–01.
The new ReadOnly type, as its name suggests, is a special typing construct to mark an item of a TypedDict as read-only.