Skip to content

Commit fcc09af

Browse files
committed
Edit docstring on getdata to match type system
See https://github.com/python-pillow/Pillow/pull/92611 for discussion on this.
1 parent 5122c83 commit fcc09af

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/PIL/Image.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1159,7 +1159,8 @@ def convert_transparency(
11591159
if new_im.mode == "P" and new_im.palette:
11601160
try:
11611161
new_im.info["transparency"] = new_im.palette.getcolor(
1162-
cast(tuple[int, ...], trns), new_im # trns was converted to RGB
1162+
cast(tuple[int, ...], trns),
1163+
new_im, # trns was converted to RGB
11631164
)
11641165
except ValueError as e:
11651166
del new_im.info["transparency"]
@@ -1433,7 +1434,7 @@ def getdata(self, band: int | None = None) -> core.ImagingCore:
14331434
Note that the sequence object returned by this method is an
14341435
internal PIL data type, which only supports certain sequence
14351436
operations. To convert it to an ordinary sequence (e.g. for
1436-
printing), use ``list(im.getdata())``.
1437+
printing), use ``list(iter(im.getdata()))``.
14371438
14381439
:param band: What band to return. The default is to return
14391440
all bands. To return a single band, pass in the index
@@ -3224,7 +3225,8 @@ class SupportsArrowArrayInterface(Protocol):
32243225
"""
32253226

32263227
def __arrow_c_array__(
3227-
self, requested_schema: "PyCapsule" = None # type: ignore[name-defined] # noqa: F821, UP037
3228+
self,
3229+
requested_schema: "PyCapsule" = None, # type: ignore[name-defined] # noqa: F821, UP037
32283230
) -> tuple["PyCapsule", "PyCapsule"]: # type: ignore[name-defined] # noqa: F821, UP037
32293231
raise NotImplementedError()
32303232

0 commit comments

Comments
 (0)