Use PEP 585 syntax in Python 2, protobuf & _ast stubs, where possible (#6949)

This commit is contained in:
Alex Waygood
2022-01-18 15:14:03 +00:00
committed by GitHub
parent aa885ecd65
commit 8af5e0d340
264 changed files with 2217 additions and 2411 deletions

View File

@@ -1,6 +1,6 @@
from array import array
from mmap import mmap
from typing import Any, Text, Tuple, Union
from typing import Any, Text, Union
class error(Exception): ...
@@ -10,8 +10,8 @@ _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: ...
def unpack(__format: _FmtType, __buffer: _BufferType) -> Tuple[Any, ...]: ...
def unpack_from(__format: _FmtType, buffer: _BufferType, offset: int = ...) -> Tuple[Any, ...]: ...
def unpack(__format: _FmtType, __buffer: _BufferType) -> tuple[Any, ...]: ...
def unpack_from(__format: _FmtType, buffer: _BufferType, offset: int = ...) -> tuple[Any, ...]: ...
def calcsize(__format: _FmtType) -> int: ...
class Struct:
@@ -20,5 +20,5 @@ class Struct:
def __init__(self, format: _FmtType) -> None: ...
def pack(self, *v: Any) -> bytes: ...
def pack_into(self, buffer: _WriteBufferType, offset: int, *v: Any) -> None: ...
def unpack(self, __buffer: _BufferType) -> Tuple[Any, ...]: ...
def unpack_from(self, buffer: _BufferType, offset: int = ...) -> Tuple[Any, ...]: ...
def unpack(self, __buffer: _BufferType) -> tuple[Any, ...]: ...
def unpack_from(self, buffer: _BufferType, offset: int = ...) -> tuple[Any, ...]: ...