What does PEP 695 introduce?
Type hints and typing
Audio flashcard · 0:20Nortren·
What does PEP 695 introduce?
0:20
PEP 695, accepted for Python 3.12, introduces a new dedicated syntax for declaring type aliases, generic functions, and generic classes. Instead of TypeVar declarations, you can write a generic function using bracket notation directly after the name. This is cleaner and more Pythonic than the older typing-based approach.
---
peps.python.org