fromarray: add type hints

This commit is contained in:
Adam J. Stewart 2024-04-02 17:45:06 +02:00
parent aeeb596c98
commit 4915f19b13
No known key found for this signature in database
GPG Key ID: C66C0675661156FC

View File

@ -3069,7 +3069,7 @@ def frombuffer(mode, size, data, decoder_name="raw", *args):
return frombytes(mode, size, data, decoder_name, args)
def fromarray(obj, mode=None):
def fromarray(obj: "numpy.typing.ArrayLike", mode: Optional[str] = None) -> Image:
"""
Creates an image memory from an object exporting the array interface
(using the buffer protocol)::