Python 3.13 Release Notes
Release Date: October 7, 2024
Python 3.13 is a stable release that introduces significant improvements to the interpreter, typing system, and developer experience.
What's New in Python 3.13
Performance Improvements
- Continued CPython optimizations and memory improvements.
- Foundations for future performance features such as JIT compilation.
- Reduced memory usage in some cases (e.g. docstrings and internal structures).
Interpreter and Runtime
-
New interactive interpreter (REPL):
- Multiline editing with history support.
- Built-in commands like
help,exit,quitwithout parentheses. - Syntax highlighting and colored tracebacks by default. :contentReference[oaicite:0]{index=0}
-
Experimental free-threaded mode (PEP 703):
- Optional build without the Global Interpreter Lock (GIL).
- Enables better multi-core utilization. :contentReference[oaicite:1]{index=1}
-
Experimental JIT compiler (PEP 744):
- Early groundwork for future runtime optimizations. :contentReference[oaicite:2]{index=2}
Language and Typing
-
Support for default values in type parameters.
-
New typing features:
typing.TypeIsfor type narrowing.- Read-only fields for
TypedDict. - Type-level deprecation annotations. :contentReference[oaicite:3]{index=3}
-
Defined semantics for
locals()mutations:- Improves debugger and introspection consistency. :contentReference[oaicite:4]{index=4}
Standard Library
-
New features and improvements:
base64.z85encode()/z85decode()for Z85 encoding.copy.replace()for structured object copying.dbm.sqlite3becomes the default backend fordbm.- New CLI for the
randommodule. - New exception:
PythonFinalizationError. :contentReference[oaicite:5]{index=5}
-
Improvements in modules like
argparse,os,ssl, and others.
Platforms and Compatibility
- WASI promoted to Tier 2 support.
- iOS and Android introduced as Tier 3 platforms. :contentReference[oaicite:6]{index=6}
Removals and Deprecations
- Removal of many legacy modules ("dead batteries"), including:
cgi,telnetlib,aifc,audioop, and others.
- Ongoing cleanup of deprecated APIs in the standard library and C API. :contentReference[oaicite:7]{index=7}
Migration Notes
Upgrading from Python 3.12 is generally straightforward, but consider:
- Removed deprecated modules and APIs.
- Changes in typing behavior.
- Testing code that depends on internal or undocumented behavior.