Skip to content

Commit

Permalink
Add type hints
Browse files Browse the repository at this point in the history
Co-authored-by: Andrew Murray <[email protected]>
  • Loading branch information
hugovk and radarhere authored Apr 1, 2024
1 parent 008b28e commit 7c5d0b9
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/PIL/Image.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ def size(self) -> tuple[int, int]:
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
Expand Down Expand Up @@ -1347,9 +1347,7 @@ def getbbox(self, *, alpha_only: bool = True) -> tuple[int, int, int, int]:
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.
Expand Down

0 comments on commit 7c5d0b9

Please sign in to comment.