value based equivalence

This commit is contained in:
wiredfool 2015-10-25 14:17:50 +00:00
parent deecbcd3a3
commit 3bbb9e676f

View File

@ -282,6 +282,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):