Standalone subscripted alias expression fails mypy check
@sobolevn がすでに取り組んでいます。
2022年8月11日 から。
- 主要言語
- Python
- スター
- 20.6k
- フォーク
- 3.3k
- PR マージ指標
- PR 指標を取得中
説明
Bug Report
Standalone subscripted alias expression raises the error "Type application is only supported for generic classes"
To Reproduce
Here's a reproducible playground link: https://mypy-play.net/?mypy=0.971&python=3.10&gist=e262d3dd99f2a708e96eb28338792632
Code:
T = TypeVar("T")
OptionalT: TypeAlias = Optional[T]
OptionalT[int] # error: Type application is only supported for generic classes
Expected Behavior
I was surprised that you couldn't have a free expression of the subscripted generic type alias. Standalone expressions like Optional[int] obviously work, as does X where X: TypeAlias = int.
Actual Behavior
The free expression gives the error: Type application is only supported for generic classes in the playground
Your Environment
The environment is python 3.10, mypy 0.971.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
評価
この issue はまだ評価されていません。