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,4 +1,4 @@
from typing import Any, BinaryIO, Generic, Iterable, List, MutableSequence, Text, Tuple, TypeVar, Union, overload
from typing import Any, BinaryIO, Generic, Iterable, MutableSequence, Text, TypeVar, Union, overload
from typing_extensions import Literal
_IntTypeCode = Literal["b", "B", "h", "H", "i", "I", "l", "L", "q", "Q"]
@@ -20,12 +20,12 @@ class array(MutableSequence[_T], Generic[_T]):
@overload
def __init__(self, typecode: str, __initializer: bytes | Iterable[_T] = ...) -> None: ...
def append(self, __v: _T) -> None: ...
def buffer_info(self) -> Tuple[int, int]: ...
def buffer_info(self) -> tuple[int, int]: ...
def byteswap(self) -> None: ...
def count(self, __v: Any) -> int: ...
def extend(self, __bb: Iterable[_T]) -> None: ...
def fromfile(self, __f: BinaryIO, __n: int) -> None: ...
def fromlist(self, __list: List[_T]) -> None: ...
def fromlist(self, __list: list[_T]) -> None: ...
def fromunicode(self, __ustr: str) -> None: ...
def index(self, __v: _T) -> int: ... # type: ignore # Overrides Sequence
def insert(self, __i: int, __v: _T) -> None: ...
@@ -34,7 +34,7 @@ class array(MutableSequence[_T], Generic[_T]):
def remove(self, __v: Any) -> None: ...
def reverse(self) -> None: ...
def tofile(self, __f: BinaryIO) -> None: ...
def tolist(self) -> List[_T]: ...
def tolist(self) -> list[_T]: ...
def tounicode(self) -> str: ...
def write(self, f: BinaryIO) -> None: ...
def fromstring(self, __buffer: bytes) -> None: ...