def is_str_list(obj: object) -> TypeIs[list[str]]: return isinstance(obj, list) and all(isinstance(x, str) for x in obj) The static checker (mypy 2.0, Pyright 1.8) refines types after the call. This enables for complex data shapes like JSON blobs or AST nodes.
def divide(a, b): return a / b result = divide(10, 0) python 3.13 release news december 2025
Python 3.13: The Quiet Horizon — A December 2025 Retrospective Some corrode
The standard library is no longer “batteries included” but “batteries curated.” Some batteries leak. Some corrode. Python 3.13 acknowledges maintenance debt and cuts cleanly. For the first time since 3.9, Python 3.13 introduces a Limited C API stability guarantee across 3.x minor versions . Extension modules compiled for 3.13 will work with 3.14, 3.15, unless they use unstable internal APIs. Extension modules compiled for 3
Now you can write: