-
-
Notifications
You must be signed in to change notification settings - Fork 37
Closed
Description
mypy_extensions.TypedDict
is problematic for several reasons:
mypy_extensions.TypedDict
is missing quite a few features that have been added totyping.TypedDict
at runtime (and have been backported totyping_extensions.TypedDict
).- I think the existence of both
mypy_extensions.TypedDict
andtyping_extensions.TypedDict
has the potential to be pretty confusing for users. - It's quite annoying and error-prone that at typeshed, we have to remember to keep
typing._TypedDict
,typing_extensions._TypedDict
andmypy_extensions._TypedDict
all in sync. Unfortunately, we can't put them all in_typeshed
and have all three modules import_TypedDict
from_typeshed
, as the three classes all have slightly subtle differences. (E.g.mypy_extensions._TypedDict
doesn't have the__required_keys__
and__optional_keys__
ClassVars that bothtyping._TypedDict
andtyping_extensions._TypedDict
have.) - Mypy now maintains its own copy of the
mypy-extensions
stubs anyway, so its stubs formypy_extensions
are no longer automatically updated with each typeshed sync. That means that even if we update the stubs formypy_extensions.TypedDict
in typeshed (as we did in Improve__(r)or__
signatures for TypedDict classes typeshed#10565), those updates are no longer of any benefit to mypy users unless mypy maintainers remember to copy across the changes to their forked version of themypy_extensions
stubs.
I propose that we deprecate mypy_extensions.TypedDict
, and steer people towards typing_extensions.TypedDict
instead: it's up-to-date with the features on typing.TypedDict
, it's much more comprehensively tested, and it has up-to-date stubs.
Thoughts?
JelleZijlstra and davidfstr
Metadata
Metadata
Assignees
Labels
No labels