i needed hash to use Link objects as keys of dict.
On 4/20/09, Liangent liangent@gmail.com wrote:
already committed?
and there are some problems else:
pywikibot.Page(pywikibot.Site(), 'talk:1').get() this raises pywikibot.exceptions.Error
(maybe a little bit difficult) can you add transaction support for pywikibot?
On 4/20/09, Nicolas Dumazet nicdumz@gmail.com wrote:
Oh, interesting.
For those wondering, this is related to Link in pywikibot.page (rewrite branch).
What were you hashing Link objects for?
What about:
Index: pywikibot/page.py
--- pywikibot/page.py (revision 6639) +++ pywikibot/page.py (working copy) @@ -1945,7 +1945,13 @@ 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 = []):
I believe that it should be correct, knowing that astext() should not change from one instance to another.
-- Nicolas Dumazet — NicDumZ [ nɪk.d̪ymz ]
Pywikipedia-l mailing list Pywikipedia-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l