mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 21:14:48 +08:00
Use _typeshed.Self with __enter__ (#5712)
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
from _typeshed import Self
|
||||
from mmap import mmap
|
||||
from typing import IO, Any, BinaryIO, Iterable, List, Optional, Text, TextIO, Tuple, Type, TypeVar, Union
|
||||
|
||||
@@ -30,7 +31,7 @@ class _IOBase(BinaryIO):
|
||||
def tell(self) -> int: ...
|
||||
def truncate(self, size: Optional[int] = ...) -> int: ...
|
||||
def writable(self) -> bool: ...
|
||||
def __enter__(self: _T) -> _T: ...
|
||||
def __enter__(self: Self) -> Self: ...
|
||||
def __exit__(
|
||||
self, t: Optional[Type[BaseException]], value: Optional[BaseException], traceback: Optional[Any]
|
||||
) -> Optional[bool]: ...
|
||||
@@ -56,7 +57,7 @@ class _BufferedIOBase(_IOBase):
|
||||
class BufferedRWPair(_BufferedIOBase):
|
||||
def __init__(self, reader: _RawIOBase, writer: _RawIOBase, buffer_size: int = ..., max_buffer_size: int = ...) -> None: ...
|
||||
def peek(self, n: int = ...) -> bytes: ...
|
||||
def __enter__(self) -> BufferedRWPair: ...
|
||||
def __enter__(self: Self) -> Self: ...
|
||||
|
||||
class BufferedRandom(_BufferedIOBase):
|
||||
mode: str
|
||||
@@ -140,7 +141,7 @@ class _TextIOBase(TextIO):
|
||||
def writable(self) -> bool: ...
|
||||
def write(self, pbuf: unicode) -> int: ...
|
||||
def writelines(self, lines: Iterable[unicode]) -> None: ...
|
||||
def __enter__(self: _T) -> _T: ...
|
||||
def __enter__(self: Self) -> Self: ...
|
||||
def __exit__(
|
||||
self, t: Optional[Type[BaseException]], value: Optional[BaseException], traceback: Optional[Any]
|
||||
) -> Optional[bool]: ...
|
||||
|
||||
Reference in New Issue
Block a user