mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-08-26 07:04:45 +03:00
Type annotations: Amend eq/ne to be (object)->bool.
This commit is contained in:
parent
4c45a312f0
commit
2d0fb6b979
|
@ -662,8 +662,8 @@ class Image(object):
|
||||||
|
|
||||||
return filename
|
return filename
|
||||||
|
|
||||||
def __eq__(self, other): # type: ignore # type: (Image) -> bool
|
def __eq__(self, other):
|
||||||
# type: (Image) -> bool
|
# type: (object) -> bool
|
||||||
return (isinstance(other, Image) and
|
return (isinstance(other, Image) and
|
||||||
self.__class__.__name__ == other.__class__.__name__ and
|
self.__class__.__name__ == other.__class__.__name__ and
|
||||||
self.mode == other.mode and
|
self.mode == other.mode and
|
||||||
|
@ -674,7 +674,8 @@ class Image(object):
|
||||||
self.getpalette() == other.getpalette() and
|
self.getpalette() == other.getpalette() and
|
||||||
self.tobytes() == other.tobytes())
|
self.tobytes() == other.tobytes())
|
||||||
|
|
||||||
def __ne__(self, other): # type: ignore # type: (Image) -> bool
|
def __ne__(self, other):
|
||||||
|
# type: (object) -> bool
|
||||||
eq = (self == other)
|
eq = (self == other)
|
||||||
return not eq
|
return not eq
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user