Xqt has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/372827 )
Change subject: [bugfix] hash for LogEntry should be unique ...................................................................... [bugfix] hash for LogEntry should be unique Per https://docs.python.org/3.4/reference/datamodel.html#object.__hash__ : "it is advised to somehow mix together (e.g. using exclusive or) the hash values for the components of the object that also play a part in comparison of objects." Bug: T173688 Change-Id: If124e1bf61e23543b8972ff65f75094c0bdd255c --- M pywikibot/logentries.py 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core refs/changes/27/372827/1 diff --git a/pywikibot/logentries.py b/pywikibot/logentries.py index 26dd3cf..3b4b768 100644 --- a/pywikibot/logentries.py +++ b/pywikibot/logentries.py @@ -56,8 +56,8 @@ self.data._type = self.type() def __hash__(self): - """Return the id as the hash.""" - return self.logid() + """Combine site and logid as the hash.""" + return self.logid() ^ hash(self.site) @property def _params(self): -- To view, visit https://gerrit.wikimedia.org/r/372827 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If124e1bf61e23543b8972ff65f75094c0bdd255c Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/core Gerrit-Branch: master Gerrit-Owner: Xqt <[email protected]> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
