mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-27 09:44:31 +03:00
value based equivalence
This commit is contained in:
parent
deecbcd3a3
commit
3bbb9e676f
|
@ -283,6 +283,13 @@ class IFDRational(Fraction):
|
|||
def __repr__(self):
|
||||
return str(float(self._val))
|
||||
|
||||
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):
|
||||
"""This class represents a TIFF tag directory. To speed things up, we
|
||||
|
|
Loading…
Reference in New Issue
Block a user