Use _typeshed.Self with __enter__ (#5717)

Co-authored-by: Akuli <akuviljanen17@gmail.com>
This commit is contained in:
Anton Grübel
2021-07-01 12:32:32 +02:00
committed by GitHub
parent 04f0113d16
commit 96e0660fba
12 changed files with 44 additions and 39 deletions

View File

@@ -1,4 +1,5 @@
import sys
from _typeshed import Self
from typing import IO, Any, NamedTuple, NoReturn, Optional, Union
_File = Union[str, IO[bytes]]
@@ -30,7 +31,7 @@ class _sunau_params(NamedTuple):
class Au_read:
def __init__(self, f: _File) -> None: ...
def __enter__(self) -> Au_read: ...
def __enter__(self: Self) -> Self: ...
def __exit__(self, *args: Any) -> None: ...
def getfp(self) -> Optional[IO[bytes]]: ...
def rewind(self) -> None: ...
@@ -50,7 +51,7 @@ class Au_read:
class Au_write:
def __init__(self, f: _File) -> None: ...
def __enter__(self) -> Au_write: ...
def __enter__(self: Self) -> Self: ...
def __exit__(self, *args: Any) -> None: ...
def setnchannels(self, nchannels: int) -> None: ...
def getnchannels(self) -> int: ...