Skip to content

Conversation

@radarhere
Copy link
Member

No description provided.

def test_sanity() -> None:
im = hopper()
assert im.thumbnail((100, 100)) is None
assert im.thumbnail((100, 100)) is None # type: ignore[func-returns-value]
Copy link
Member Author

Choose a reason for hiding this comment

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

Without this ignore, mypy reports

Tests/test_image_thumbnail.py:19: error: "thumbnail" of "Image" does not return a value (it only ever returns None) [func-returns-value]
assert im.thumbnail((100, 100)) is None
^~~~~~~~~~~~~~~~~~~~~~~~

Copy link
Contributor

Choose a reason for hiding this comment

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

Couldn't this line just be im.thumbnail((100, 100)), without the assert?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, I’ve pushed a commit.

@hugovk hugovk merged commit cde0524 into python-pillow:main Jun 18, 2024
@radarhere radarhere deleted the type_hint_tests branch June 18, 2024 23:00
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.

3 participants