From fcc09afe91ee21930dc35b4ffba444a12b2a7946 Mon Sep 17 00:00:00 2001 From: Dominic Oram Date: Thu, 16 Oct 2025 10:01:42 +0100 Subject: [PATCH] Edit docstring on getdata to match type system See https://github.com/python-pillow/Pillow/pull/92611 for discussion on this. --- src/PIL/Image.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/PIL/Image.py b/src/PIL/Image.py index 9d50812eb..40994bd5c 100644 --- a/src/PIL/Image.py +++ b/src/PIL/Image.py @@ -1159,7 +1159,8 @@ class Image: if new_im.mode == "P" and new_im.palette: try: new_im.info["transparency"] = new_im.palette.getcolor( - cast(tuple[int, ...], trns), new_im # trns was converted to RGB + cast(tuple[int, ...], trns), + new_im, # trns was converted to RGB ) except ValueError as e: del new_im.info["transparency"] @@ -1433,7 +1434,7 @@ class Image: Note that the sequence object returned by this method is an internal PIL data type, which only supports certain sequence operations. To convert it to an ordinary sequence (e.g. for - printing), use ``list(im.getdata())``. + printing), use ``list(iter(im.getdata()))``. :param band: What band to return. The default is to return all bands. To return a single band, pass in the index @@ -3224,7 +3225,8 @@ class SupportsArrowArrayInterface(Protocol): """ def __arrow_c_array__( - self, requested_schema: "PyCapsule" = None # type: ignore[name-defined] # noqa: F821, UP037 + self, + requested_schema: "PyCapsule" = None, # type: ignore[name-defined] # noqa: F821, UP037 ) -> tuple["PyCapsule", "PyCapsule"]: # type: ignore[name-defined] # noqa: F821, UP037 raise NotImplementedError()