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 IO, Any, List, NamedTuple, Text, Tuple, Union, overload
from typing import IO, Any, NamedTuple, Text, Union, overload
from typing_extensions import Literal
class Error(Exception): ...
@@ -12,7 +12,7 @@ class _aifc_params(NamedTuple):
compname: bytes
_File = Union[Text, IO[bytes]]
_Marker = Tuple[int, int, bytes]
_Marker = tuple[int, int, bytes]
class Aifc_read:
def __init__(self, f: _File) -> None: ...
@@ -28,7 +28,7 @@ class Aifc_read:
def getcomptype(self) -> bytes: ...
def getcompname(self) -> bytes: ...
def getparams(self) -> _aifc_params: ...
def getmarkers(self) -> List[_Marker] | None: ...
def getmarkers(self) -> list[_Marker] | None: ...
def getmark(self, id: int) -> _Marker: ...
def setpos(self, pos: int) -> None: ...
def readframes(self, nframes: int) -> bytes: ...
@@ -50,11 +50,11 @@ class Aifc_write:
def setcomptype(self, comptype: bytes, compname: bytes) -> None: ...
def getcomptype(self) -> bytes: ...
def getcompname(self) -> bytes: ...
def setparams(self, params: Tuple[int, int, int, int, bytes, bytes]) -> None: ...
def setparams(self, params: tuple[int, int, int, int, bytes, bytes]) -> None: ...
def getparams(self) -> _aifc_params: ...
def setmark(self, id: int, pos: int, name: bytes) -> None: ...
def getmark(self, id: int) -> _Marker: ...
def getmarkers(self) -> List[_Marker] | None: ...
def getmarkers(self) -> list[_Marker] | None: ...
def tell(self) -> int: ...
def writeframesraw(self, data: Any) -> None: ... # Actual type for data is Buffer Protocol
def writeframes(self, data: Any) -> None: ...