Subtle error in `getattr_hook` example in the Descriptor Guide
まだ誰も着手していません。
- 主要言語
- Python
- スター
- 77.2k
- フォーク
- 35.9k
- PR マージ指標
- PR 指標を取得中
説明
Documentation
The example below, from the Descriptor Guide, does not seem to reflect the behaviour of the actual implementation.
Unless I'm mistaken, line 736 return obj.__getattribute__(name) should actually read return type(obj).__getattribute__(obj, name).
It's easy to miss when thinking of class instances, but the issue becomes more evident when the example is applied to an attribute lookup on a class object instead. The example would call the __getattribute__ method of the class itself, while the actual implementation calls __getattribute__ on the metaclass (not to mention that in this case the call in the example would fail, due to a missing argument, as it is calling a plain function, rather than a bound method).
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
Doc/howto/descriptor.rst の 733-740 行付近を開き、getattr_hook の例を issue に記載されている実装の動作と比較してください。特にクラスオブジェクトの属性検索を確認してください。相違が確認された場合は、文書化されている return 式を更新し、ガイドが実装と一致していることを検証してください。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- documentation
- issue の種類
- ドキュメント
- 難易度
- 1/5
- 見積もり時間
- 1時間未満
- 活発さ
- 停滞
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 48/100