mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 13:04:46 +08:00
Use _typeshed.Self where __enter__ returns self (#5698)
This commit is contained in:
committed by
GitHub
parent
1fb100dca4
commit
58559e56b3
@@ -1,4 +1,5 @@
|
||||
import sys
|
||||
from _typeshed import Self
|
||||
from typing import IO, Any, BinaryIO, NamedTuple, NoReturn, Optional, Union
|
||||
|
||||
_File = Union[str, IO[bytes]]
|
||||
@@ -17,7 +18,7 @@ class _wave_params(NamedTuple):
|
||||
|
||||
class Wave_read:
|
||||
def __init__(self, f: _File) -> None: ...
|
||||
def __enter__(self) -> Wave_read: ...
|
||||
def __enter__(self: Self) -> Self: ...
|
||||
def __exit__(self, *args: Any) -> None: ...
|
||||
def getfp(self) -> Optional[BinaryIO]: ...
|
||||
def rewind(self) -> None: ...
|
||||
@@ -37,7 +38,7 @@ class Wave_read:
|
||||
|
||||
class Wave_write:
|
||||
def __init__(self, f: _File) -> None: ...
|
||||
def __enter__(self) -> Wave_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