From e5b15b8eda7ce9bd9481b2609b408fc1617986e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Elio=20Petten=C3=B2?= Date: Mon, 19 Nov 2018 08:44:13 +0000 Subject: [PATCH] Allow array[int] as a valid input to struct.unpack(). (#2586) There does not seem to be an easy way to express that the array needs to be of a 1-byte type ('b', 'B', or 'c' in Python 2 only), so it is a bit more permissive than it should be. --- stdlib/2and3/struct.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stdlib/2and3/struct.pyi b/stdlib/2and3/struct.pyi index cbc5e8315..c3e616d20 100644 --- a/stdlib/2and3/struct.pyi +++ b/stdlib/2and3/struct.pyi @@ -11,10 +11,10 @@ class error(Exception): ... _FmtType = Union[bytes, Text] if sys.version_info >= (3,): - _BufferType = Union[bytes, bytearray, memoryview] + _BufferType = Union[array[int], bytes, bytearray, memoryview] _WriteBufferType = Union[array, bytearray, memoryview] else: - _BufferType = Union[bytes, bytearray, buffer, memoryview] + _BufferType = Union[array[int], bytes, bytearray, buffer, memoryview] _WriteBufferType = Union[array[Any], bytearray, buffer, memoryview] def pack(fmt: _FmtType, *v: Any) -> bytes: ...