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]"
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!
Activity
hauntsaninja commented on Oct 19, 2020
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:
cpontvieux-systra commented on Sep 14, 2021
Any update or merge request to work on?
JelleZijlstra commented on Oct 8, 2021
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!
Support PEP 613
Support PEP 613 (#11305)