-
-
Notifications
You must be signed in to change notification settings - Fork 32k
Outdated example code of typing.TypedDict #107422
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
Labels
Comments
This was referenced Jul 29, 2023
AlexWaygood
pushed a commit
that referenced
this issue
Jul 29, 2023
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Jul 29, 2023
…pythonGH-107436) (cherry picked from commit 89fd4f4) Co-authored-by: Rakesh Sabale <102187286+ghubrakesh@users.noreply.github.com>
AlexWaygood
pushed a commit
that referenced
this issue
Jul 29, 2023
This has now been fixed, and backported to 3.12 and 3.11. Thanks @wanglc02 for opening the issue, and thanks @ghubrakesh for the PR fixing it! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Documentation
https://docs.python.org/3.12/library/typing.html#typing.TypedDict
Changed in version 3.11: Added support for generic TypedDicts.
The text description has already changed, too:
A TypedDict cannot inherit from a non-TypedDict class, except for Generic. For example:
On the last line of the above code,
# raises TypeError
should be# OK
. I have tested this in version 3.12. It is OK.Linked PRs
TypedDict
example from typing docs #107436TypedDict
example from typing docs (GH-107436) #107437TypedDict
example from typing docs (#107436) #107438The text was updated successfully, but these errors were encountered: