From 37ed8c337de3617bb0b17b721c0cef08e502dc3b Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Tue, 2 Apr 2024 17:53:11 +0200 Subject: [PATCH] Try type comment --- src/PIL/Image.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/PIL/Image.py b/src/PIL/Image.py index a2723756f..c932f1932 100644 --- a/src/PIL/Image.py +++ b/src/PIL/Image.py @@ -41,7 +41,7 @@ import warnings from collections.abc import Callable, MutableMapping from enum import IntEnum from types import ModuleType -from typing import IO, TYPE_CHECKING, Any +from typing import IO, Optional, TYPE_CHECKING, Any # VERSION was removed in Pillow 6.0.0. # PILLOW_VERSION was removed in Pillow 9.0.0. @@ -3069,7 +3069,10 @@ def frombuffer(mode, size, data, decoder_name="raw", *args): return frombytes(mode, size, data, decoder_name, args) -def fromarray(obj: numpy.typing.ArrayLike, mode: Optional[str] = None) -> Image: +def fromarray( + obj, # type: numpy.typing.ArrayLike + mode: Optional[str] = None +) -> Image: """ Creates an image memory from an object exporting the array interface (using the buffer protocol)::