-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
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
bpo-28556: Clarify that Type[SomeTypeVar] is legal in typing docs #9585
bpo-28556: Clarify that Type[SomeTypeVar] is legal in typing docs #9585
Conversation
Currently, the docs state that when doing `Type[X]`, X is only allowed to be a class, a union of classes, and Any. This pull request amends that sentence to clarify X may also be a typevar (or a union involving classes, Any, and TypeVars).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for updating this! LGTM.
@ilevkivskyi: Please replace |
Thanks @Michael0x2a for the PR, and @ilevkivskyi for merging it 🌮🎉.. I'm working now to backport this PR to: 3.6, 3.7. |
Currently, the docs state that when doing `Type[X]`, X is only allowed to be a class, a union of classes, and Any. This pull request amends that sentence to clarify X may also be a typevar (or a union involving classes, Any, and TypeVars). (cherry picked from commit 130717f) Co-authored-by: Michael Lee <michael.lee.0x2a@gmail.com>
Currently, the docs state that when doing `Type[X]`, X is only allowed to be a class, a union of classes, and Any. This pull request amends that sentence to clarify X may also be a typevar (or a union involving classes, Any, and TypeVars). (cherry picked from commit 130717f) Co-authored-by: Michael Lee <michael.lee.0x2a@gmail.com>
GH-9590 is a backport of this pull request to the 3.7 branch. |
GH-9591 is a backport of this pull request to the 3.6 branch. |
Currently, the docs state that when doing `Type[X]`, X is only allowed to be a class, a union of classes, and Any. This pull request amends that sentence to clarify X may also be a typevar (or a union involving classes, Any, and TypeVars). (cherry picked from commit 130717f) Co-authored-by: Michael Lee <michael.lee.0x2a@gmail.com>
Currently, the docs state that when doing `Type[X]`, X is only allowed to be a class, a union of classes, and Any. This pull request amends that sentence to clarify X may also be a typevar (or a union involving classes, Any, and TypeVars). (cherry picked from commit 130717f) Co-authored-by: Michael Lee <michael.lee.0x2a@gmail.com>
Currently, the docs state that when doing
Type[X]
, X is only allowed to be a class, a union of instances, and Any. This pull request amends that sentence to clarify X may also be a typevar (or a union involving classes, Any, and TypeVars).https://bugs.python.org/issue28556