Skip to content

Make TypeAlias stub a valid annotation #4354

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

Merged
merged 1 commit into from
Jul 23, 2020

Conversation

shannonzhu
Copy link
Contributor

Changes in #3933 and #3966 resulted in removal of TypeAlias as a class exported from the typing module.

#4243 makes TypeAlias available in typing_extensions, but it is defined as a variable as opposed to a class that can be used as a valid type (https://mypy.readthedocs.io/en/latest/common_issues.html#variables-vs-type-aliases).

Proposing this change to ensure syntax like x: TypeAlias = int as described in PEP 613 is still valid for type checkers.

@JelleZijlstra JelleZijlstra merged commit b45e6cf into python:master Jul 23, 2020
facebook-github-bot pushed a commit to facebook/pyre-check that referenced this pull request Jul 24, 2020
Summary: Include fix to make explicit aliases work again: python/typeshed#4354

Reviewed By: sinancepel

Differential Revision: D22675787

fbshipit-source-id: 6809ae93e27767d9c35749b841e40cd488645846
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants