Add support for classmethod converters in attrs plugin
オープン
まだ誰も着手していません。
feature
priority-1-normal
topic-attrs
- 主要言語
- Python
- スター
- 20.6k
- フォーク
- 3.3k
- PR マージ指標
- PR 指標を取得中
説明
import attr
@attr.s
class Bar:
b = attr.ib()
@classmethod
def make(cls, one: int) -> 'Bar':
return cls(one)
@attr.s
class Foo:
a = attr.ib(converter=Bar.make)
error: Unsupported converter, only named functions and types are currently supported
Attrs is perfectly happy with make
>>> Foo(1)
Foo(a=Bar(b=1))
Granted the converter limitations are a known issue, I couldn't find this use-case covered anywhere.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、issue の classmethod converter の例で報告されたエラーを再現し、その後 attrs plugin の converter 処理を追跡します。classmethod converter(Bar.make など)が unsupported-converter エラーなしで受け入れられ、例が引き続き正しく型チェックされれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- devtools
- issue の種類
- 機能追加
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100