From c5351d2f4882e423828e747b528179d5b1486f7e Mon Sep 17 00:00:00 2001 From: Shane Evans Date: Tue, 25 Jan 2011 19:23:50 -0200 Subject: [PATCH] add __hash__ method to Link object to be compatible with the __eq__ method --- scrapy/link.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scrapy/link.py b/scrapy/link.py index ddae07823..371a987cb 100644 --- a/scrapy/link.py +++ b/scrapy/link.py @@ -18,6 +18,9 @@ class Link(object): def __eq__(self, other): return self.url == other.url and self.text == other.text + + def __hash__(self): + return hash(self.url) ^ hash(self.text) def __repr__(self): return '' % (self.url, self.text)