You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please tell me, how to update stubs in .pyi files.
I have a problem with the modul Piilow.
The code in Image .pyi has the prototype def fromarray(obj, mode: _Mode | None = ...) -> Image: ...
and _Mode is defined as _Mode = Literal["1", "CMYK", "F", "HSV", "I", "L", "LAB", "P", "RGB", "RGBA", "RGBX", "YCbCr"]
But the function fromarray awaits the type str for mode.
Thank you for your answer
Erhy
The text was updated successfully, but these errors were encountered:
IIRC the intent is that these are the only valid inputs to mode-like parameters, hence it being a literal set of values. Having written a good bulk of PIL stubs, they do document a specific list of values.
If you think that the types are wrong, I would suggest filing an issue on typeshed to discuss it.
Now 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.
Please tell me, how to update stubs in .pyi files.
I have a problem with the modul Piilow.
The code in Image .pyi has the prototype
def fromarray(obj, mode: _Mode | None = ...) -> Image: ...
and _Mode is defined as
_Mode = Literal["1", "CMYK", "F", "HSV", "I", "L", "LAB", "P", "RGB", "RGBA", "RGBX", "YCbCr"]
But the function fromarray awaits the type str for mode.
Thank you for your answer
Erhy
The text was updated successfully, but these errors were encountered: