Brian Rosner  committed ce2c2f2

Fixed #26 -- implemented __eq__ and __hash__ on Link to ensure they are
compared correctly in a set

This fixes the infinite recursion in PackageFinder._get_queued_page. The
seen set was being used, but since there is a bit of recursion in the links
comparing Link instances was failing sending it into an infinite loop.

  • Participants
  • Parent commits d348a2b
  • Branches trunk

Comments (0)

Files changed (1)

     def __repr__(self):
         return '<Link %s>' % self
+    def __eq__(self, other):
+        return self.url == other.url
+    def __hash__(self):
+        return hash(self.url)
     def filename(self):
         url = self.url