Render @property-@name.setter pattern for rw properties in stubgenc
まだ誰も着手していません。
評価
調査の方向性
まず、stubgenc における readwrite プロパティの現在の処理を特定し、推論されたクラスフィールドがどのように出力されるかを確認します。生成されたスタブが要求された @property と @name.setter の組み合わせを使用し、issue に示されている getter と setter のアノテーションが付くようになれば、作業は完了です。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Python
- スター
- 20.6k
- フォーク
- 3.3k
- 平均マージ
- 1日 18時間
- マージ済み PR(30日)
- 54
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
python/mypy のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
bug topic-configuration topic-error-reporting
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
zostera/django-bootstrap4#894 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
use-agent-os/agent-os#3276 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
zephyrproject-rtos/zephyr#119726 ·
-
area/auth bug comp/agent P3 platform/discord type/security
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
NousResearch/hermes-agent#117848 ·