-
-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deprecate mypy_extensions.TypedDict
?
#46
Comments
Agree, there's no need for mypy_extensions.TypedDict any more. As an implementation strategy, we can:
|
I'm taking a look at the runtime side of things. One issue: it seems we'd really need Foo = TypedDict('Foo', {'x': int}) ...But you'd need class Bar(TypedDict):
x: int I'm not sure if there's a way to distinguish between the two, if we emit the |
Hmm, I think I have a solution |
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
).mypy_extensions.TypedDict
andtyping_extensions.TypedDict
has the potential to be pretty confusing for users.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-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 towardstyping_extensions.TypedDict
instead: it's up-to-date with the features ontyping.TypedDict
, it's much more comprehensively tested, and it has up-to-date stubs.Thoughts?
The text was updated successfully, but these errors were encountered: