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 @@
import io
from _typeshed import ReadableBuffer, Self, WriteableBuffer
from typing import IO, Any, Iterable, List, Text, Union
from typing import IO, Any, Iterable, Text, Union
from typing_extensions import SupportsIndex
_PathOrFile = Union[Text, IO[bytes]]
@@ -15,7 +15,7 @@ class BZ2File(io.BufferedIOBase, IO[bytes]):
def read1(self, size: int = ...) -> bytes: ...
def readline(self, size: SupportsIndex = ...) -> bytes: ... # type: ignore
def readinto(self, b: WriteableBuffer) -> int: ...
def readlines(self, size: SupportsIndex = ...) -> List[bytes]: ...
def readlines(self, size: SupportsIndex = ...) -> list[bytes]: ...
def seek(self, offset: int, whence: int = ...) -> int: ...
def write(self, data: ReadableBuffer) -> int: ...
def writelines(self, seq: Iterable[ReadableBuffer]) -> None: ...