mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 05:24:52 +08:00
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.
This commit is contained in:
committed by
Sebastian Rittau
parent
9a92056105
commit
e5b15b8eda
@@ -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: ...
|
||||
|
||||
Reference in New Issue
Block a user