python / typing

Python static typing home. Hosts the documentation and a user help forum.
https://typing.readthedocs.io/
Other
1.6k stars 235 forks source link

Spec: Mandate support for typing-extensions #1532

Open JelleZijlstra opened 11 months ago

JelleZijlstra commented 11 months ago

The typing spec should mandate that type checkers support the typing_extensions module by treating any name imported from it as equivalent to the same name in typing.

This is noncontroversial (I hope!), but it's still a substantive change to the spec, so it should go through the procedure in https://github.com/python/typing-council?tab=readme-ov-file#decisions. I'll likely do that in January.

JelleZijlstra commented 5 months ago

This was arguably addressed by the type expressions change (#1693), now at https://typing.readthedocs.io/en/latest/spec/annotations.html#type-and-annotation-expressions, which says "Most special forms must be imported from typing or typing_extensions". However, it's probably still useful to have a section mentioning typing-extensions more explicitly.