PEP 742: Narrowing types with TypeNarrower
This PEP proposes a new special form, TypeNarrower, to allow annotating functions that can be used to narrow the type of a value, similar to the builtin isinstance(). Unlike the existing typing.TypeGuard special form, TypeNarrower can narrow the type in both the if and else branches of a conditional. ⌘ Read more

⤋ Read More

Participate

Login to join in on this yarn.