From 7c5d0b9284144e785ee17cb9395063747d4ab180 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Sun, 31 Mar 2024 23:44:27 -0600 Subject: [PATCH] Add type hints Co-authored-by: Andrew Murray <3112309+radarhere@users.noreply.github.com> --- src/PIL/Image.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/PIL/Image.py b/src/PIL/Image.py index b92c0bb43..baef0aa11 100644 --- a/src/PIL/Image.py +++ b/src/PIL/Image.py @@ -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.