From 2d0fb6b97935359c67aaf8d65ee4f1ea4ddb1cff Mon Sep 17 00:00:00 2001 From: "neiljp (Neil Pilgrim)" Date: Sat, 19 Aug 2017 17:03:33 -0700 Subject: [PATCH] Type annotations: Amend eq/ne to be (object)->bool. --- src/PIL/Image.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/PIL/Image.py b/src/PIL/Image.py index 145eaeec6..df3a57e24 100644 --- a/src/PIL/Image.py +++ b/src/PIL/Image.py @@ -662,8 +662,8 @@ class Image(object): return filename - def __eq__(self, other): # type: ignore # type: (Image) -> bool - # type: (Image) -> bool + def __eq__(self, other): + # type: (object) -> bool return (isinstance(other, Image) and self.__class__.__name__ == other.__class__.__name__ and self.mode == other.mode and @@ -674,7 +674,8 @@ class Image(object): self.getpalette() == other.getpalette() and self.tobytes() == other.tobytes()) - def __ne__(self, other): # type: ignore # type: (Image) -> bool + def __ne__(self, other): + # type: (object) -> bool eq = (self == other) return not eq