`pygit2.remote.RemoteCollection` should implement `__contains__()` to match with valid remote names
まだ誰も着手していません。
評価
調査の方向性
pygit2.remote.RemoteCollection から始めて、既存の getitem() の動作を確認します。'origin' を使った issue のメンバーシップ例を再現し、その後、collection が contains() をサポートしたら、メンバーシップが有効な remote 名と一致し、無効な名前を拒否することを検証します。
索引モデルが issue の本文から書いたものです。
説明
As it stands the following happens
>>> import os, pygit2
>>> r = pygit2.Repository(os.getcwd())
>>> 'origin' in r.remotes
False
Whereas looping over the names results in a match
>>> import os, pygit2
>>> r = pygit2.Repository(os.getcwd())
>>> 'origin' in [remote.name for remote in r.remotes]
True
This behavior seems unpythonic since remote.RemoteCollection implements __getitem__() and in doesn't match with a valid key in the collection.
If this change makes sense I can to try fix it when I have time, lmk!
- 主要言語
- Python
- スター
- 1.7k
- フォーク
- 408
- 平均マージ
- 2日 57分
- マージ済み PR(30日)
- 7
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
libgit2/pygit2 のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 48/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
learningequality/ricecooker#747 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
BSData/horus-heresy-3rd-edition#3171 ·
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
run-llama/llama_index#23199 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
KhronosGroup/glTF-Blender-IO#2769 ·