mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-09 17:38:00 +00:00
numbertheory.py: make the ModP class hashable.
That will let me keep them in sets.
This commit is contained in:
parent
3ee9b92935
commit
7be2e16023
@ -177,3 +177,5 @@ class ModP(object):
|
||||
return "0x{:x}".format(self.n)
|
||||
def __repr__(self):
|
||||
return "{}(0x{:x},0x{:x})".format(type(self).__name__, self.p, self.n)
|
||||
def __hash__(self):
|
||||
return hash((type(self).__name__, self.p, self.n))
|
||||
|
Loading…
Reference in New Issue
Block a user