We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
We could perhaps support final TypedDicts that don't allow subtypes to have extra keys. Example:
from typing import final, TypedDict @final class A(TypedDict): x: int @final class B(TypedDict): x: int y: str def f(d: A) -> None: ... d: B = {...} f(d) # Error -- extra key 'y'
Here are some random thoughts:
values()
I haven't thought carefully about all the implications of this feature. Before implementing this, some additional analysis would be useful.
See #10759 for more context.
The text was updated successfully, but these errors were encountered:
Previous discussion: #7981
Sorry, something went wrong.
Closing as dupe of #7981, oops.
No branches or pull requests
We could perhaps support final TypedDicts that don't allow subtypes to have extra keys. Example:
Here are some random thoughts:
values()
, since there can't be extra "hidden" values with arbitrary types.I haven't thought carefully about all the implications of this feature. Before implementing this, some additional analysis would be useful.
See #10759 for more context.
The text was updated successfully, but these errors were encountered: