Add type hint for LOAD_TRUNCATED_IMAGES#9351
Open
bencevans wants to merge 1 commit intopython-pillow:mainfrom
Open
Add type hint for LOAD_TRUNCATED_IMAGES#9351bencevans wants to merge 1 commit intopython-pillow:mainfrom
bencevans wants to merge 1 commit intopython-pillow:mainfrom
Conversation
Member
Author
|
Hi! Ah this will teach me for trying out new toys haha. I'm using ty in VS Code. It's interesting it's picked up as a Literal, it seems stricter than other type checkers. Forgot to include in the original message but also using |
Member
|
Thanks. I can verify that your fix does satisfy ty. While the change you've suggested here is minor, I expect there will be other ty problems lurking. I'm somewhat hesitant about trying to satisfy multiple type checkers at once, particularly when ty is still in beta. |
Member
|
Mypy is pretty slow, it would be good to move to a new fast one such as ty or pyrefly at some point. But I've not really looked into them, and with default settings report over 300 and 600 errors each... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Changes proposed in this pull request:
Adds a type hint for ImageFile.LOAD_TRUNCATED_IMAGES.
Sets the type to
bool, otherwiseLiteral[False]is assumed causing a lint error when settingImageFile.LOAD_TRUNCATED_IMAGES = True.