Allow to register new class/dataclass/attribute makers in attrs plugin
まだ誰も着手していません。
- 主要言語
- Python
- スター
- 20.6k
- フォーク
- 3.3k
- PR マージ指標
- PR 指標を取得中
説明
This is a feature request.
attrs is very much intended to be composable (e.g. https://github.com/hynek/environ_config) but currently the attrs plugin only works on the core library's functions: https://github.com/python/mypy/blob/b2d61741623f2a0573f2b1bdb8391ceed862cf69/mypy/plugins/attrs.py#L24-L37
I would like to be able to signal somehow to mypy, that some function is a wrapper around @attr.s/@attr.ib/@attr.dataclass. Not only would third-party applications benefit, but I could really use it while experimenting on https://github.com/python-attrs/attrs/issues/408.
Any ideas/plans how we could achieve that?
cc also @euresti & @chadrik
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
mypy/plugins/attrs.py から始め、特に 24–37 行付近に挙げられているコアライブラリ関数を確認し、attrs プラグインが @attr.s、@attr.ib、@attr.dataclass をどのように認識するかを追ってください。動機となったラッパーのユースケースについては、リンク先の attrs issue を確認してください。クラス、dataclass、または属性メーカーに相当する動作をサードパーティー製ラッパーから登録するための、文書化されテストされた方法があれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- devtools
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 静か
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 35/100