Lokal Profil has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/358786 )
Change subject: Make WbRepresentations hashable
......................................................................
Make WbRepresentations hashable
Bug: T167827
Change-Id: If6631bdcd430a4f067ac05b790dadacba3d8f343
---
M pywikibot/_wbtypes.py
1 file changed, 3 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core
refs/changes/86/358786/1
diff --git a/pywikibot/_wbtypes.py b/pywikibot/_wbtypes.py
index cc68d67..7071ac4 100644
--- a/pywikibot/_wbtypes.py
+++ b/pywikibot/_wbtypes.py
@@ -50,5 +50,8 @@
return self.toWikibase() == other.toWikibase()
return NotImplemented
+ def __hash__(self):
+ return hash(frozenset(self.toWikibase().items()))
+
def __ne__(self, other):
return not self.__eq__(other)
--
To view, visit https://gerrit.wikimedia.org/r/358786
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: If6631bdcd430a4f067ac05b790dadacba3d8f343
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Lokal Profil <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits