bpo-28556: Clarify that Type[SomeTypeVar] is legal in typing docs by Michael0x2a · Pull Request #9585 · python/cpython (original) (raw)
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 andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation5 Commits1 Checks0 Files changed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})
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
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).
ilevkivskyi changed the title
Clarify that Type[SomeTypeVar] is legal in typing docs bpo-28556: Clarify that Type[SomeTypeVar] is legal in typing docs
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 #
with GH-
in the commit message next time. Thanks!
Thanks @Michael0x2a for the PR, and @ilevkivskyi for merging it 🌮🎉.. I'm working now to backport this PR to: 3.6, 3.7.
🐍🍒⛏🤖
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request
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
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request
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
miss-islington added a commit that referenced this pull request
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
miss-islington added a commit that referenced this pull request
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