[3.13] 3.13 What's New: Add PEP 702 (GH-118922) (#119062)

I honestly forgot this slipped into 3.13, but I think it's worth highlighting more, as it is a PEP-sized change that makes the type system significantly more powerful.

@Yhg1s I think it's also worth mentioning in your release announcements.
(cherry picked from commit ee13797dec)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
This commit is contained in:
Miss Islington (bot) 2024-05-15 04:56:37 +02:00 committed by GitHub
parent 8439d09aa1
commit dd8a61f901
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -104,6 +104,9 @@ New typing features:
* :pep:`696`: Type parameters (:data:`typing.TypeVar`, :data:`typing.ParamSpec`, * :pep:`696`: Type parameters (:data:`typing.TypeVar`, :data:`typing.ParamSpec`,
and :data:`typing.TypeVarTuple`) now support defaults. and :data:`typing.TypeVarTuple`) now support defaults.
* :pep:`702`: Support for marking deprecations in the type system using the
new :func:`warnings.deprecated` decorator.
* :pep:`742`: :data:`typing.TypeIs` was added, providing more intuitive * :pep:`742`: :data:`typing.TypeIs` was added, providing more intuitive
type narrowing behavior. type narrowing behavior.