Switch to PEP-604 syntax in python2 stubs (#5915)

Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
This commit is contained in:
Oleg Höfling
2021-08-14 11:12:30 +02:00
committed by GitHub
parent 431c4f7fc1
commit ff63953188
235 changed files with 2473 additions and 2768 deletions

View File

@@ -1,4 +1,4 @@
from typing import IO, Any, NoReturn, Optional, Text, Tuple, Union
from typing import IO, Any, NoReturn, Text, Tuple, Union
_File = Union[Text, IO[bytes]]
@@ -23,7 +23,7 @@ _sunau_params = Tuple[int, int, int, int, str, str]
class Au_read:
def __init__(self, f: _File) -> None: ...
def getfp(self) -> Optional[IO[bytes]]: ...
def getfp(self) -> IO[bytes] | None: ...
def rewind(self) -> None: ...
def close(self) -> None: ...
def tell(self) -> int: ...
@@ -37,7 +37,7 @@ class Au_read:
def getmarkers(self) -> None: ...
def getmark(self, id: Any) -> NoReturn: ...
def setpos(self, pos: int) -> None: ...
def readframes(self, nframes: int) -> Optional[bytes]: ...
def readframes(self, nframes: int) -> bytes | None: ...
class Au_write:
def __init__(self, f: _File) -> None: ...
@@ -61,6 +61,6 @@ class Au_write:
def close(self) -> None: ...
# Returns a Au_read if mode is rb and Au_write if mode is wb
def open(f: _File, mode: Optional[str] = ...) -> Any: ...
def open(f: _File, mode: str | None = ...) -> Any: ...
openfp = open