diff --git a/PIL/Image.py b/PIL/Image.py index e392c7ed6..8f260cea3 100644 --- a/PIL/Image.py +++ b/PIL/Image.py @@ -642,8 +642,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 @@ -654,7 +654,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