mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-26 09:14:27 +03:00
Make IFDRational hashable
This commit is contained in:
parent
3bbb9e676f
commit
f9fe4da8b2
|
@ -283,12 +283,16 @@ class IFDRational(Fraction):
|
|||
def __repr__(self):
|
||||
return str(float(self._val))
|
||||
|
||||
def __hash__(self):
|
||||
return self._val.__hash__()
|
||||
|
||||
def __eq__(self,other):
|
||||
if type(other) == float:
|
||||
return float(self) == other
|
||||
if type(other) == int:
|
||||
return float(self) == float(int(self)) and int(self) == other
|
||||
return float(self) == float(other)
|
||||
|
||||
|
||||
|
||||
class ImageFileDirectory_v2(collections.MutableMapping):
|
||||
|
|
Loading…
Reference in New Issue
Block a user