Skip to content

Conversation

@radarhere
Copy link
Member

@radarhere radarhere commented Dec 27, 2024

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

  1. Uses monkeypatch for
    def im_draft(
    mode: str, size: tuple[int, int]
    ) -> tuple[str, tuple[int, int, float, float]] | None:
    result = draft(mode, size)
    assert result is not None
    return result
    im.draft = im_draft
  2. Updates the type arguments in the mock method to match

    Pillow/src/PIL/Image.py

    Lines 1326 to 1327 in f9767fb

    def draft(
    self, mode: str | None, size: tuple[int, int] | None

@hugovk hugovk merged commit 4db5be1 into python-pillow:main Dec 27, 2024
48 checks passed
@radarhere radarhere deleted the monkeypatch branch December 27, 2024 19:49
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.

2 participants