Render @property-@name.setter pattern for rw properties in stubgenc
オープン
まだ誰も着手していません。
feature
topic-descriptors
topic-stubgen
- 主要言語
- Python
- スター
- 20.6k
- フォーク
- 3.3k
- 平均マージ
- 1日 18時間
- マージ済み PR(30日)
- 54
説明
Feature
Currently, stubgen renders the readwrite properties as a plain class field with inferred type. e.g.
in a pybind11 module
cls.def_property("my_property", &MyClass::GetProperty, &MyClass::SetProperty);
will result in
class MyClass:
my_property: int
Could it be possible to render a @property-@name.setter pair instead, like:
class MyClass:
@property
def my_property(self) -> int: ...
@my_property.setter
def my_property(self, val: int) -> None: ...
Pitch
This way can more clearly reflect the fact that it is a property. I'm happy to help create a PR for this.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、stubgenc における readwrite プロパティの現在の処理を特定し、推論されたクラスフィールドがどのように出力されるかを確認します。生成されたスタブが要求された @property と @name.setter の組み合わせを使用し、issue に示されている getter と setter のアノテーションが付くようになれば、作業は完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- tooling
- issue の種類
- 機能追加
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 42/100