Skip to content

Adjust tuple construction in ImageGrab to fix mypy on macOS - #9935

Merged
radarhere merged 1 commit into
python-pillow:mainfrom
akx:imagegrab-tuple-type
Sep 1, 2026
Merged

Adjust tuple construction in ImageGrab to fix mypy on macOS#9935
radarhere merged 1 commit into
python-pillow:mainfrom
akx:imagegrab-tuple-type

Conversation

@akx

@akx akx commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Split out per #9803 (comment)

@akx akx mentioned this pull request Sep 1, 2026

@hugovk hugovk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, on macOS, on main I get:

tox -e mypy
mypy: commands[0]> mypy conftest.py selftest.py setup.py checks docs src winbuild Tests
src/PIL/ImageGrab.py:82: error: Argument "box" to "resize" of "Image" has incompatible
type "tuple[int, ...]"; expected "tuple[float, float, float, float] | None"  [arg-type]
                                box=tuple(coord * 2 for coord in bbox),
                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Found 1 error in 1 file (checked 302 source files)
mypy: exit 1 (2.58 seconds) /Users/hugo/github/Pillow> mypy conftest.py selftest.py setup.py checks docs src winbuild Tests pid=84969
  mypy: FAIL code 1 (2.58=setup[0.00]+cmd[2.58] seconds)
  evaluation failed :( (2.63 seconds)

And with this PR:

tox -e mypy
mypy: commands[0]> mypy conftest.py selftest.py setup.py checks docs src winbuild Tests
Success: no issues found in 302 source files
  mypy: OK (2.22=setup[0.00]+cmd[2.22] seconds)
  congratulations :) (2.27 seconds)

@radarhere radarhere changed the title Adjust tuple construction in ImageGrab to make mypy happy Adjust tuple construction in ImageGrab to fix mypy on macOS Sep 1, 2026
@radarhere radarhere added the macOS label Sep 1, 2026
@radarhere
radarhere enabled auto-merge (squash) September 1, 2026 10:45
@radarhere
radarhere merged commit c3078e7 into python-pillow:main Sep 1, 2026
63 of 65 checks passed
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.

3 participants