Skip to content
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

Merged

Conversation

Michael0x2a
Copy link
Contributor

@Michael0x2a Michael0x2a commented Sep 26, 2018

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).
@bedevere-bot bedevere-bot added the docs Documentation in the Doc dir label Sep 26, 2018
@ilevkivskyi ilevkivskyi changed the title Clarify that Type[SomeTypeVar] is legal in typing docs bpo-28556: Clarify that Type[SomeTypeVar] is legal in typing docs Sep 26, 2018
Copy link
Member

@ilevkivskyi ilevkivskyi left a 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 ilevkivskyi merged commit 130717f into python:master Sep 26, 2018
@bedevere-bot
Copy link

@ilevkivskyi: Please replace # with GH- in the commit message next time. Thanks!

@miss-islington
Copy link
Contributor

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 Sep 26, 2018
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 Sep 26, 2018
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>
@bedevere-bot
Copy link

GH-9590 is a backport of this pull request to the 3.7 branch.

@bedevere-bot
Copy link

GH-9591 is a backport of this pull request to the 3.6 branch.

miss-islington added a commit that referenced this pull request Sep 26, 2018
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 Sep 26, 2018
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants