types.MappingProxyType states that proxy[key] will throw a KeyError, but that is not always true
まだ誰も着手していません。
- 主要言語
- Python
- スター
- 77.2k
- フォーク
- 35.9k
- PR マージ指標
- PR 指標を取得中
説明
Documentation
In the documentation, it states proxy[key] will:
Return the item of the underlying mapping with key key. Raises a KeyError if key is not in the underlying mapping.
https://docs.python.org/3/library/types.html#types.MappingProxyType
However, it is possible to get an AttributeError instead, and in fact, unit tests for the dataclasses module require this to be true (metadata in dataclasses.field is wrapped in a mapping proxy):
The unit tests above are from Python3.12.
Looks like the CPython source code only forwards the getitem call to the inner mapping:
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
リンク先の Python ドキュメントページにある MappingProxyType のドキュメントから始め、続いてその記述を、参照されている dataclasses のテストおよび Objects/descrobject.c の実装と比較してください。テストと実装で示されている例外の動作をドキュメントが正確に説明していれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- documentation
- issue の種類
- ドキュメント
- 難易度
- 1/5
- 見積もり時間
- 1時間未満
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 58/100