]> code.communitydata.science - rises_declines_wikia_code.git/blob - mediawiki_dump_tools/Mediawiki-Utilities/mw/lib/reverts/dummy_checksum.py
Initial commit
[rises_declines_wikia_code.git] / mediawiki_dump_tools / Mediawiki-Utilities / mw / lib / reverts / dummy_checksum.py
1 class DummyChecksum():
2     """
3     Used in when checking for reverts when the checksum of the revision of interest
4     is unknown.  DummyChecksums won't match eachother or anything else, but they
5     will match themselves and they are hashable.
6
7     >>> dummy1 = DummyChecksum()
8     >>> dummy1
9     <#140687347334280>
10     >>> dummy1 == dummy1
11     True
12     >>>
13     >>> dummy2 = DummyChecksum()
14     >>> dummy2
15     <#140687347334504>
16     >>> dummy1 == dummy2
17     False
18     >>>
19     >>> {"foo", "bar", dummy1, dummy1, dummy2}
20     {<#140687347334280>, 'foo', <#140687347334504>, 'bar'}
21     """
22     
23     def __str__(self): repr(self)
24     def __repr__(self): return "<#" + str(id(self)) + ">"

Community Data Science Collective || Want to submit a patch?