mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 04:54:47 +08:00
Use _typeshed.Self with __enter__ (#5717)
Co-authored-by: Akuli <akuviljanen17@gmail.com>
This commit is contained in:
@@ -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: ...
|
||||
|
||||
Reference in New Issue
Block a user