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

Corrected argument types #8681

Merged
merged 2 commits into from
Jan 16, 2025
Merged

Corrected argument types #8681

merged 2 commits into from
Jan 16, 2025

Conversation

radarhere
Copy link
Member

This is part of #8362 - I'm hoping to break down that PR into easier-to-review chunks.

  1. im.remap_palette(None)

    should use a list, as per

Pillow/src/PIL/Image.py

Lines 2138 to 2140 in af3b904

def remap_palette(
self, dest_map: list[int], source_palette: bytes | bytearray | None = None
) -> Image:

  1. exif.load(None)

    should use a bytestring, as per
    def load(self, data: bytes) -> None:

  2. im.resize((10, 10), "unknown")
    should use an int (or None) for the second argument, as per

    Pillow/src/PIL/Image.py

    Lines 2250 to 2256 in af3b904

    def resize(
    self,
    size: tuple[int, int] | list[int] | NumpyArray,
    resample: int | None = None,
    box: tuple[float, float, float, float] | None = None,
    reducing_gap: float | None = None,
    ) -> Image:

@hugovk hugovk merged commit df7e42e into python-pillow:main Jan 16, 2025
48 checks passed
@radarhere radarhere deleted the types branch January 16, 2025 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants