Akuli and srittau: Remove Python 2 branches from Python 3 stubs (#5461)

* run script and do some manual changes (Akuli)

* do the whole thing manually (srittau)

* merge changes (Akuli)

Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
This commit is contained in:
Akuli
2021-05-15 15:33:39 +03:00
committed by GitHub
parent b0ef85288d
commit 17dcea4a68
106 changed files with 1539 additions and 3275 deletions

View File

@@ -1,5 +1,5 @@
import sys
from typing import IO, Any, NamedTuple, NoReturn, Optional, Text, Tuple, Union
from typing import IO, Any, NamedTuple, NoReturn, Optional, Text, Union
_File = Union[Text, IO[bytes]]
@@ -20,23 +20,18 @@ AUDIO_FILE_ENCODING_ADPCM_G723_5: int
AUDIO_FILE_ENCODING_ALAW_8: int
AUDIO_UNKNOWN_SIZE: int
if sys.version_info >= (3, 0):
class _sunau_params(NamedTuple):
nchannels: int
sampwidth: int
framerate: int
nframes: int
comptype: str
compname: str
else:
_sunau_params = Tuple[int, int, int, int, str, str]
class _sunau_params(NamedTuple):
nchannels: int
sampwidth: int
framerate: int
nframes: int
comptype: str
compname: str
class Au_read:
def __init__(self, f: _File) -> None: ...
if sys.version_info >= (3, 3):
def __enter__(self) -> Au_read: ...
def __exit__(self, *args: Any) -> None: ...
def __enter__(self) -> Au_read: ...
def __exit__(self, *args: Any) -> None: ...
def getfp(self) -> Optional[IO[bytes]]: ...
def rewind(self) -> None: ...
def close(self) -> None: ...
@@ -55,9 +50,8 @@ class Au_read:
class Au_write:
def __init__(self, f: _File) -> None: ...
if sys.version_info >= (3, 3):
def __enter__(self) -> Au_write: ...
def __exit__(self, *args: Any) -> None: ...
def __enter__(self) -> Au_write: ...
def __exit__(self, *args: Any) -> None: ...
def setnchannels(self, nchannels: int) -> None: ...
def getnchannels(self) -> int: ...
def setsampwidth(self, sampwidth: int) -> None: ...