Type annotations: Adjust __repr__ return & ignore ne/eq.

This commit is contained in:
neiljp (Neil Pilgrim) 2017-08-17 22:31:59 -07:00
parent 1e29eef1f4
commit 0fa2b7c498

View File

@ -647,7 +647,7 @@ class Image(object):
return filename
def __eq__(self, other):
def __eq__(self, other): # type: ignore # type: (Image) -> bool
# type: (Image) -> bool
return (isinstance(other, Image) and
self.__class__.__name__ == other.__class__.__name__ and
@ -659,13 +659,12 @@ class Image(object):
self.getpalette() == other.getpalette() and
self.tobytes() == other.tobytes())
def __ne__(self, other):
# type: (Image) -> bool
def __ne__(self, other): # type: ignore # type: (Image) -> bool
eq = (self == other)
return not eq
def __repr__(self):
# type: () -> Text
# type: () -> str
return "<%s.%s image mode=%s size=%dx%d at 0x%X>" % (
self.__class__.__module__, self.__class__.__name__,
self.mode, self.size[0], self.size[1],