Update __dataclass_params__ to track actual changes made by decorator
@ericvsmith がすでに取り組んでいます。
2022年11月23日 から。
- 主要言語
- Python
- スター
- 77.2k
- フォーク
- 36k
- PR マージ指標
- PR 指標を取得中
説明
Several of the options available via the dataclass decorator, such as repr, hash, and eq, are ignored if the corresponding methods are already in the class being decorated; however, they still have their default value of True. This makes it difficult, if not impossible, to discern whether a dataclass' special method was given by dataclass or if the user wrote it.
As an example of the introspection concern, Enum uses __dataclass_params__.repr to decide if it should use a dataclass-specific repr, or use the dataclass' repr. Without this enhancement, the user has to both specify @dataclass(repr=False) and include their new __repr__ method, instead of just including the new __repr__ and having dataclass automatically set __dataclass_params__.repr to False.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
評価
この issue はまだ評価されていません。