Spec and conformance tests disagree on converting constructors into callable for classes with `__new__` and `__init__`
オープン
まだ誰も着手していません。
topic: conformance tests
topic: typing spec
- 主要言語
- Python
- スター
- 1.8k
- フォーク
- 302
- 平均マージ
- 23時間
- マージ済み PR(30日)
- 8
説明
For classes with both __new__ and __init__, when converting the constructor into a Callable, the spec says that
class B:
""" __new__ and __init__ """
def __new__(cls, *args, **kwargs) -> Self:
...
def __init__(self, x: int) -> None:
...
reveal_type(accepts_callable(B)) # ``def (*args, **kwargs) -> B | def (x: int) -> B``
The conformance test says that
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
docs/spec/constructors.rst のリンクされたセクション付近に記載されているコンストラクターの動作を、conformance/tests/constructors_callable.py のケースと比較してください。new と init の両方を定義するクラスに対して意図されている callable の型を特定し、その後、仕様と適合性テストを一致させ、関連するコンストラクター適合性チェックを実行してください。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- documentation, testing-qa
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 48/100