Fix writeframes type in wave (#6997)

This commit is contained in:
Nikita Sobolev
2022-01-22 23:11:58 +03:00
committed by GitHub
parent de5ec6a0d1
commit 7ab84cfebf

View File

@@ -1,12 +1,13 @@
import sys
from _typeshed import Self
from _typeshed import ReadableBuffer, Self
from typing import IO, Any, BinaryIO, NamedTuple, NoReturn, Union
from typing_extensions import Literal
_File = Union[str, IO[bytes]]
class Error(Exception): ...
WAVE_FORMAT_PCM: int
WAVE_FORMAT_PCM: Literal[1]
class _wave_params(NamedTuple):
nchannels: int
@@ -57,9 +58,8 @@ class Wave_write:
def getmark(self, id: Any) -> NoReturn: ...
def getmarkers(self) -> None: ...
def tell(self) -> int: ...
# should be any bytes-like object after 3.4, but we don't have a type for that
def writeframesraw(self, data: bytes) -> None: ...
def writeframes(self, data: bytes) -> None: ...
def writeframesraw(self, data: ReadableBuffer) -> None: ...
def writeframes(self, data: ReadableBuffer) -> None: ...
def close(self) -> None: ...
# Returns a Wave_read if mode is rb and Wave_write if mode is wb