mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-10 05:51:52 +08:00
Switch to PEP-604 syntax in python2 stubs (#5915)
Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
from typing import IO, Any, List, NamedTuple, Optional, Text, Tuple, Union, overload
|
||||
from typing import IO, Any, List, NamedTuple, Text, Tuple, Union, overload
|
||||
from typing_extensions import Literal
|
||||
|
||||
class Error(Exception): ...
|
||||
@@ -28,7 +28,7 @@ class Aifc_read:
|
||||
def getcomptype(self) -> bytes: ...
|
||||
def getcompname(self) -> bytes: ...
|
||||
def getparams(self) -> _aifc_params: ...
|
||||
def getmarkers(self) -> Optional[List[_Marker]]: ...
|
||||
def getmarkers(self) -> List[_Marker] | None: ...
|
||||
def getmark(self, id: int) -> _Marker: ...
|
||||
def setpos(self, pos: int) -> None: ...
|
||||
def readframes(self, nframes: int) -> bytes: ...
|
||||
@@ -54,7 +54,7 @@ class Aifc_write:
|
||||
def getparams(self) -> _aifc_params: ...
|
||||
def setmark(self, id: int, pos: int, name: bytes) -> None: ...
|
||||
def getmark(self, id: int) -> _Marker: ...
|
||||
def getmarkers(self) -> Optional[List[_Marker]]: ...
|
||||
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: ...
|
||||
@@ -65,10 +65,10 @@ def open(f: _File, mode: Literal["r", "rb"]) -> Aifc_read: ...
|
||||
@overload
|
||||
def open(f: _File, mode: Literal["w", "wb"]) -> Aifc_write: ...
|
||||
@overload
|
||||
def open(f: _File, mode: Optional[str] = ...) -> Any: ...
|
||||
def open(f: _File, mode: str | None = ...) -> Any: ...
|
||||
@overload
|
||||
def openfp(f: _File, mode: Literal["r", "rb"]) -> Aifc_read: ...
|
||||
@overload
|
||||
def openfp(f: _File, mode: Literal["w", "wb"]) -> Aifc_write: ...
|
||||
@overload
|
||||
def openfp(f: _File, mode: Optional[str] = ...) -> Any: ...
|
||||
def openfp(f: _File, mode: str | None = ...) -> Any: ...
|
||||
|
||||
Reference in New Issue
Block a user