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

Pillow stub fromarray wrong declared #6027

Closed
Erhie opened this issue Sep 11, 2021 · 1 comment
Closed

Pillow stub fromarray wrong declared #6027

Erhie opened this issue Sep 11, 2021 · 1 comment

Comments

@Erhie
Copy link

Erhie commented Sep 11, 2021

Asking
microsoft/pylance-release#1798
Jake Bailey means it should be answered here.

But I had success by uninstall and newly installed Pillow and
purge in ....vscode\extensions\ms-python.vscode-pylance-2021.9.1\dist\typeshed-fallback\stubs\Pillow
and now there is no warning for this issue.

Erhy

@srittau
Copy link
Collaborator

srittau commented Sep 11, 2021

This is deliberate. mode only accepts the values specified in the Literal value. If your code uses a variable for the mode parameter, I suggest to annotate it with PIL.Image._Mode. This could require quoting if using older Python versions and not using from __future__ import annotations. We also have a help forum for further questions: https://github.com/python/typing/discussions

@srittau srittau closed this as completed Sep 11, 2021
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

No branches or pull requests

2 participants