-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Add rudimentary Pillow stubs #5594
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
Conversation
But the stub doesn't contain |
Yes, it's very incomplete. (But it has the required |
So in a stub, having |
I thought it does, but I could be wrong. I will add empty stubs if that's not the case. |
I just checked with mypy and the following passes with these stubs: from PIL.X import Y
reveal_type(Y) # Revealed type is "Any" |
@overload | ||
def getdraw(im: None = ..., hints: Container[Literal["nicest"]] | None = ...) -> tuple[None, Any]: ... | ||
@overload | ||
def getdraw(im: Image, hints: Container[Literal["nicest"]] | None = ...) -> tuple[Image, Any]: ... |
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.
Are you sure tuple[Foo, Bar]
is not affected by the mypy bug?
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.
It's only tuple[X, ...]
and tuple
(as well as others) in type aliases.
Fixed the merge conflict by removing it from the pyright exclude list. |
Wish I had seen this; I have stubbed out quite a bit of PIL on our stub staging repo: https://github.com/microsoft/python-type-stubs/tree/main/PIL |
No description provided.