Revision: 6657 Author: nicdumz Date: 2009-04-22 02:17:00 +0000 (Wed, 22 Apr 2009)
Log Message: ----------- Adding a __hash__ method to pywikibot.Link per http://lists.wikimedia.org/pipermail/pywikipedia-l/2009-April/005800.html
Modified Paths: -------------- branches/rewrite/pywikibot/page.py
Modified: branches/rewrite/pywikibot/page.py =================================================================== --- branches/rewrite/pywikibot/page.py 2009-04-22 02:15:13 UTC (rev 6656) +++ branches/rewrite/pywikibot/page.py 2009-04-22 02:17:00 UTC (rev 6657) @@ -1945,6 +1945,12 @@ return cmp(self.namespace, other.namespace) return cmp(self.title, other.title)
+ def __unicode__(self): + return self.astext() + + def __hash__(self): + return hash(self.astext()) + # Utility functions for parsing page titles
def html2unicode(text, ignore = []):
pywikipedia-svn@lists.wikimedia.org