mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 05:24:52 +08:00
Add mmap as a valid buffer type. (#2895)
This commit is contained in:
committed by
Sebastian Rittau
parent
d371513b80
commit
f11d061849
@@ -6,16 +6,17 @@
|
||||
import sys
|
||||
from typing import Any, Tuple, Text, Union, Iterator
|
||||
from array import array
|
||||
from mmap import mmap
|
||||
|
||||
class error(Exception): ...
|
||||
|
||||
_FmtType = Union[bytes, Text]
|
||||
if sys.version_info >= (3,):
|
||||
_BufferType = Union[array[int], bytes, bytearray, memoryview]
|
||||
_WriteBufferType = Union[array, bytearray, memoryview]
|
||||
_BufferType = Union[array[int], bytes, bytearray, memoryview, mmap]
|
||||
_WriteBufferType = Union[array, bytearray, memoryview, mmap]
|
||||
else:
|
||||
_BufferType = Union[array[int], bytes, bytearray, buffer, memoryview]
|
||||
_WriteBufferType = Union[array[Any], bytearray, buffer, memoryview]
|
||||
_BufferType = Union[array[int], bytes, bytearray, buffer, memoryview, mmap]
|
||||
_WriteBufferType = Union[array[Any], bytearray, buffer, memoryview, mmap]
|
||||
|
||||
def pack(fmt: _FmtType, *v: Any) -> bytes: ...
|
||||
def pack_into(fmt: _FmtType, buffer: _WriteBufferType, offset: int, *v: Any) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user