Use PEP 604 syntax wherever possible (#7493)

This commit is contained in:
Alex Waygood
2022-03-16 15:01:33 +00:00
committed by GitHub
parent 15e21a8dc1
commit 3ab250eec8
174 changed files with 472 additions and 490 deletions

View File

@@ -1,12 +1,12 @@
from array import array
from mmap import mmap
from typing import Any, Text, Union
from typing import Any, Text
class error(Exception): ...
_FmtType = Union[bytes, Text]
_BufferType = Union[array[int], bytes, bytearray, buffer, memoryview, mmap]
_WriteBufferType = Union[array[Any], bytearray, buffer, memoryview, mmap]
_FmtType = bytes | Text
_BufferType = array[int] | bytes | bytearray | buffer | memoryview | mmap
_WriteBufferType = 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: ...