-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Typing difficulty because Image
is a module and also a class
#6676
Comments
related #6614 |
Image
is a module and also a classImage
is a module and also a class
While this might have been an unfortunate choice from days long ago, is there really any way to improve this situation without breaking almost all code that currently uses Pillow? |
I don't think anybody can do much more with such a double bind. But something should be done. |
I've created PR #7639 as a possible solution to this, adding This is not intended to in any way mark |
Further thought has decided against #7639.
Internal discussion has agreed that we shouldn't make a breaking change, for the sake of backwards compatibility, so there is nothing to be done here. |
What did you do?
and got
Module "PIL.Image" is not valid as a typemypy(error)
.What did you expect to happen?
functions such as
Image.open
are classmethod of classImage
.What actually happened?
Image
was actually an module, so for typing you need to typeImage.Image
, such asWhat are your OS, Python and Pillow versions?
The text was updated successfully, but these errors were encountered: