-
Notifications
You must be signed in to change notification settings - Fork 0
Reverted changes #1
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
base: typing/strict
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,7 +41,6 @@ | |
| except ImportError: | ||
| ElementTree = None | ||
|
|
||
|
|
||
| TEST_FILE = "Tests/images/hopper.jpg" | ||
|
|
||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,13 +21,10 @@ | |
| else: | ||
| CapsuleType = object | ||
|
|
||
| if TYPE_CHECKING: | ||
| from typing_extensions import Buffer | ||
| if sys.version_info >= (3, 12): | ||
| from collections.abc import Buffer | ||
| else: | ||
| if sys.version_info >= (3, 12): | ||
| from collections.abc import Buffer | ||
| else: | ||
| Buffer = Any | ||
|
Comment on lines
-24
to
-30
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will ensure that Buffer annotations aren't Any on python<3.12. The reason this doesn't influence mypy's reports in CI is because the mypy job uses Python 3.12
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But if you want we could just revert this. It's somewhat out of scope, after all.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If I test this on Python 3.11, it still passes - https://github.com/radarhere/Pillow/actions/runs/21477253617/job/61864264358
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah yea of course, ignore my previous comment about Ci versions; |
||
| Buffer = Any | ||
|
Comment on lines
+24
to
+27
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah I figured it out! In So by undoing this change, mypy will interpret To illustrate: if you locally change the So most of these changes are necessary. Without them, the annotations will be invalid on
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, to try and test different versions properly then, I've created python-pillow#9414 |
||
|
|
||
|
|
||
| _Ink = float | tuple[int, ...] | str | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm strange, I thought this was an LSP violation 🤔. Maybe it's a mypy false negative? Either way, I'm fine with reverting this :)