Add positional-only parameters
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- python
調査の方向性
Start with PEP 570 and the issue's Point example, then examine how attrs' attrib option and generated repr currently handle parameters. Define the expected positional-only behavior and verify that the example produces Point((0, 1, 2)) rather than Point(_data=(0, 1, 2)).
索引モデルが issue の本文から書いたものです。
説明
With PEP 570, positional-only parameters were introduced.
Similarly to keyword-only parameters, I would like to see these as an option for attrs.
One thing that makes them "special" is that the __repr__ method would behave differently for positional-only parameters than it would for regular positional parameters.
An example I would use in my libraries:
from attr import attrib, attrs
@attrs(auto_attribs=True)
class Point:
"""A three-dimensional point."""
_data: Tuple[float, float, float] = attrib(positional_only=True)
print(Point((0, 1, 2)))
The output would then be
Point((0, 1, 2))
instead of
Point(_data=(0, 1, 2))
If this were a desirable feature, would this be a good "first pull request" I could follow up on?
- 主要言語
- Python
- スター
- 5.8k
- フォーク
- 480
- 平均マージ
- 2時間 15分
- マージ済み PR(30日)
- 2
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
python-attrs/attrs のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
python-attrs/attrs#1620 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
python-attrs/attrs#1596 · コメント 2 件 · リアクション 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
python-attrs/attrs#1549 · コメント 3 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 38/100
python-attrs/attrs#1543 · コメント 2 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
python-attrs/attrs#1532 ·
python-attrs/attrs の issue をすべて見る
似ている issue
-
bug confirmed issue
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
open-webui/open-webui#30750 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
OpenwaterHealth/openmotion-bloodflow-app#604 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
good first issue
難易度 1/5 1時間未満 初心者へのやさしさ 90/100