Skip to content

Commit

Permalink
Allow array[int] as a valid input to struct.unpack(). (python#2586)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Flameeyes authored and Jiri Suchan committed Jan 23, 2019
1 parent b11556f commit e049916
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions stdlib/2and3/struct.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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: ...
Expand Down

0 comments on commit e049916

Please sign in to comment.