fix IFDRational equality

This commit is contained in:
luphord 2020-07-24 16:17:15 +02:00 committed by Andrew Murray
parent 101e8f84b6
commit 78e971913c

View File

@ -353,6 +353,12 @@ class IFDRational(Rational):
return self._val.__hash__()
def __eq__(self, other):
if isinstance(other, IFDRational):
if self.denominator == 0 and other.denominator == 0:
# in this case self._val and other._val would be NaN
return self.numerator == other.numerator
return self._val == other._val
else:
return self._val == other
def _delegate(op):