Add type hints

Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com>
This commit is contained in:
Hugo van Kemenade 2024-03-31 23:44:27 -06:00 committed by GitHub
parent 008b28eb0c
commit 7c5d0b9284
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -524,7 +524,7 @@ class Image:
def mode(self): def mode(self):
return self._mode return self._mode
def _new(self, im: Image): def _new(self, im) -> Image:
new = Image() new = Image()
new.im = im new.im = im
new._mode = im.mode new._mode = im.mode
@ -1347,9 +1347,7 @@ class Image:
self.load() self.load()
return self.im.getbbox(alpha_only) return self.im.getbbox(alpha_only)
def getcolors( def getcolors(self, maxcolors: int = 256):
self, maxcolors: int = 256
) -> list[tuple[int, int | tuple[int, ...]]] | None:
""" """
Returns a list of colors used in this image. Returns a list of colors used in this image.