add Object.__eq__ and Object.__hash__
オープン
まだ誰も着手していません。
feature
- 主要言語
- Python
- スター
- 1.7k
- フォーク
- 408
- 平均マージ
- 2日 57分
- マージ済み PR(30日)
- 7
説明
It would be intuitive if this worked:
r = Repository('.git')
r['103ea4507a9df26a19388cd4115c8bfd1fb784af'] == r['103ea4507a9df26a19388cd4115c8bfd1fb784af']
I'd like to add a __eq__ method to Object which compares the underlying Oid object held by the id attribute.
Additionally, since this this attribute is read-only Objects are effectively immutable, thus it would be great to have a __hash__ method (which returns hash(self.id)) so that Objects can be placed in sets and used as keys in dictionaries.
I'm happy to make the PR for this if you think it makes sense.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず Object のエントリーポイントとその読み取り専用の id 属性を特定し、次に Repository の検索でオブジェクトがどのように生成されるかを調べます。Repository('.git') の例を使って、要求された等価性とハッシュの動作を検証します。これには、オブジェクトを集合に格納し、辞書のキーとして使用できることも含まれます。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- git, python
- 領域
- backend
- issue の種類
- 機能追加
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 45/100