Skip to content

Added default values for _Tile offset and args#8553

Merged
hugovk merged 3 commits intopython-pillow:mainfrom
radarhere:tile
Dec 27, 2024
Merged

Added default values for _Tile offset and args#8553
hugovk merged 3 commits intopython-pillow:mainfrom
radarhere:tile

Conversation

@radarhere
Copy link
Copy Markdown
Member

class _Tile(NamedTuple):
codec_name: str
extents: tuple[int, int, int, int] | None
offset: int
args: tuple[Any, ...] | str | None

Adding defaults of 0 for offset and None for args will allow small simplifications to some instantiations of ImageFile._Tile.

An args value of (mode, 0, 1) can also be replaced by mode

Pillow/src/PIL/ImageFile.py

Lines 221 to 222 in 5bff2f3

if isinstance(args, str):
args = (args, 0, 1)

@radarhere radarhere removed the Cleanup label Dec 11, 2024
@hugovk hugovk merged commit 2c3395f into python-pillow:main Dec 27, 2024
@radarhere radarhere deleted the tile branch December 27, 2024 19:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants