Skip to content
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

Import PIL.Image explicitly over PIL #26490

Merged
merged 1 commit into from
Aug 13, 2023
Merged

Conversation

QuLogic
Copy link
Member

@QuLogic QuLogic commented Aug 10, 2023

PR summary

We seem to use PIL.Image.* pretty often while only importing PIL. This mostly works, but seems to be by fluke depending on what may or may not have imported PIL.Image beforehand.

For example, if you have a file that just does import matplotlib.widgets (which itself imports only PIL), then mypy will crash due to incomplete PIL.

PR checklist

We seem to use `PIL.Image.*` pretty often while only importing `PIL`.
This mostly works, but seems to be by fluke depending on what may or may
not have imported `PIL.Image`.

For example, if you have a file that just does `import
matplotlib.widgets` (which itself imports only `PIL`), then `mypy` will
crash due to incomplete `PIL`.
@QuLogic QuLogic added this to the v3.8.0 milestone Aug 10, 2023
@story645 story645 merged commit bba391d into matplotlib:main Aug 13, 2023
38 checks passed
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Aug 13, 2023
ksunden added a commit that referenced this pull request Aug 14, 2023
…490-on-v3.8.x

Backport PR #26490 on branch v3.8.x (Import PIL.Image explicitly over PIL)
@QuLogic QuLogic deleted the pil-image branch August 14, 2023 22:30
@ksunden ksunden mentioned this pull request Sep 15, 2023
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants