← Back to team overview

dulwich-users team mailing list archive

[PATCH v2 1/6] pack.PackIndex: de-duplicate __iter__ implementation

 

The PackIndex class has two __iter__ implementations. Pick the latter
one and remove the earlier one.
---
 dulwich/pack.py |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/dulwich/pack.py b/dulwich/pack.py
index 1312ee4..817e4ed 100644
--- a/dulwich/pack.py
+++ b/dulwich/pack.py
@@ -243,7 +243,7 @@ class PackIndex(object):
 
     def __iter__(self):
         """Iterate over the SHAs in this pack."""
-        raise NotImplementedError(self.__iter__)
+        return imap(sha_to_hex, self._itersha())
 
     def iterentries(self):
         """Iterate over the entries in this pack index.
@@ -278,10 +278,6 @@ class PackIndex(object):
         """
         raise NotImplementedError(self._object_index)
 
-    def __iter__(self):
-        """Iterate over the SHAs in this pack."""
-        return imap(sha_to_hex, self._itersha())
-
     def objects_sha1(self):
         """Return the hex SHA1 over all the shas of all objects in this pack.
 
-- 
1.7.3.2.msysgit.0




Follow ups

References