mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-28 02:04:36 +03:00
Make IFDRational hashable
This commit is contained in:
parent
3bbb9e676f
commit
f9fe4da8b2
|
@ -283,6 +283,9 @@ class IFDRational(Fraction):
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return str(float(self._val))
|
return str(float(self._val))
|
||||||
|
|
||||||
|
def __hash__(self):
|
||||||
|
return self._val.__hash__()
|
||||||
|
|
||||||
def __eq__(self,other):
|
def __eq__(self,other):
|
||||||
if type(other) == float:
|
if type(other) == float:
|
||||||
return float(self) == other
|
return float(self) == other
|
||||||
|
@ -291,6 +294,7 @@ class IFDRational(Fraction):
|
||||||
return float(self) == float(other)
|
return float(self) == float(other)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class ImageFileDirectory_v2(collections.MutableMapping):
|
class ImageFileDirectory_v2(collections.MutableMapping):
|
||||||
"""This class represents a TIFF tag directory. To speed things up, we
|
"""This class represents a TIFF tag directory. To speed things up, we
|
||||||
don't decode tags unless they're asked for.
|
don't decode tags unless they're asked for.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user