Allow Ellipsis as annotation for inferred type
まだ誰も着手していません。
評価
調査の方向性
まず PEP 484 とこの issue の例を読み、実装ファイルもテストも特定されていないことを確認してください。受け入れテストを定義する前に、意図された Ellipsis のセマンティクスと影響を受ける型チェッカーの動作を明確にしてください。issue にはスコープが定められた変更ではなく提案が記録されているためです。
索引モデルが issue の本文から書いたものです。
説明
PEP 484 says that if an annotation is missing then the type assumed to be Any
def f(x) -> None:
reveal_type(x) # Revealed type is 'Any'
def g(x: int):
pass
reveal_type(g(1)) # Revealed type is 'Any'
However, it is not clear how to say to type checker that it should infer a missing type, rather than assume that it is Any. It was proposed by @ncoghlan to use Ellipsis for this purpose:
def f(x: ...) -> None:
...
def g(x: int) -> ...:
...
I am opening this issue, so that this idea will not be forgotten.
- 主要言語
- Python
- スター
- 1.8k
- フォーク
- 302
- 平均マージ
- 23時間
- マージ済み PR(30日)
- 8
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
python/typing のほかの issue
-
topic: typing spec
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
topic: typing spec
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
topic: documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
topic: documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
topic: conformance tests topic: typing spec
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
似ている issue
-
fix: inaccuracy ⚠️
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
uabrc/uabrc.github.io#1255 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
ethereum-optimism/factory#64 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
duckdb/duckdb-python#627 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
documentation
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
Qiskit/qiskit-addon-sqd#376 ·