Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Support PEP 613 #9404

Closed
Hibou57 opened this issue Sep 3, 2020 · 3 comments · Fixed by #11305
Closed

Support PEP 613 #9404

Hibou57 opened this issue Sep 3, 2020 · 3 comments · Fixed by #11305
Labels
feature topic-type-alias TypeAlias and other type alias issues

Comments

@Hibou57
Copy link

Hibou57 commented Sep 3, 2020

🚀 Feature

Support type aliasing as in PEP 613

Pitch

Conclusion in this comment of a closed issue: #9402 (comment)

@hauntsaninja
Copy link
Collaborator

One small note here is that we should be mindful of the intersection with from __future__ import annotations and PEP 585. That is, it would be nice to support the following on Python 3.7:

from __future__ import annotations
x: TypeAlias = "list[int]"

@cpontvieux-systra
Copy link

Any update or merge request to work on?

@JelleZijlstra
Copy link
Member

For anyone interested in seeing this feature, I suspect it's going to be relatively easy to implement since it won't affect any type-checking logic: it's just additions to the parser and semantic analyzer to recognize type aliases in a new context. Contributions would be welcome!

hauntsaninja pushed a commit to hauntsaninja/mypy that referenced this issue Oct 10, 2021
hauntsaninja added a commit that referenced this issue Oct 12, 2021
Resolves #9404

Co-authored-by: hauntsaninja <>
@JelleZijlstra JelleZijlstra added the topic-type-alias TypeAlias and other type alias issues label Mar 22, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
feature topic-type-alias TypeAlias and other type alias issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants