Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added default values for _Tile offset and args #8553

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

radarhere
Copy link
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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant