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