Explorar o código

Implement Tree.__contains__.

Jelmer Vernooij %!s(int64=16) %!d(string=hai) anos
pai
achega
1872cb5751
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      dulwich/objects.py

+ 3 - 0
dulwich/objects.py

@@ -371,6 +371,9 @@ class Tree(ShaFile):
             raise NotTreeError(filename)
         return tree
 
+    def __contains__(self, name):
+        return name in self._entries
+
     def __getitem__(self, name):
         return self._entries[name]