Revision: 6498
Author:   nicdumz
Date:     2009-03-08 09:09:32 +0000 (Sun, 08 Mar 2009)

Log Message:
-----------
Adding __hash__ function so that these objects can be used in dicts

Modified Paths:
--------------
    branches/rewrite/pywikibot/data/logentries.py

Modified: branches/rewrite/pywikibot/data/logentries.py
===================================================================
--- branches/rewrite/pywikibot/data/logentries.py       2009-03-08 01:02:45 UTC 
(rev 6497)
+++ branches/rewrite/pywikibot/data/logentries.py       2009-03-08 09:09:32 UTC 
(rev 6498)
@@ -38,6 +38,9 @@
             raise Error("Wrong log type! Expecting %s, received %s instead." \
                         % (self._expectedType, self.type()))
      
+    def __hash__(self):
+        return self.logid()
+
     def logid(self):
         return self.data['logid']
     



_______________________________________________
Pywikipedia-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l

Reply via email to