mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-09 21:12:25 +08:00
Add _TemporaryFileWrapper (#4559)
This commit is contained in:
@@ -164,6 +164,39 @@ else:
|
||||
dir: Optional[_DirT[AnyStr]] = ...,
|
||||
) -> IO[Any]: ...
|
||||
|
||||
class _TemporaryFileWrapper(IO[str]):
|
||||
file: IO[str]
|
||||
name: Any
|
||||
delete: bool
|
||||
def __init__(self, file: IO[str], name: Any, delete: bool = ...) -> None: ...
|
||||
def __enter__(self) -> _TemporaryFileWrapper: ...
|
||||
def __exit__(
|
||||
self, exc: Optional[Type[BaseException]], value: Optional[BaseException], tb: Optional[TracebackType]
|
||||
) -> Optional[bool]: ...
|
||||
def __getattr__(self, name: str) -> Any: ...
|
||||
def close(self) -> None: ...
|
||||
def unlink(self, path: str) -> None: ...
|
||||
# These methods don't exist directly on this object, but
|
||||
# are delegated to the underlying IO object through __getattr__.
|
||||
# We need to add them here so that this class is concrete.
|
||||
def __iter__(self) -> Iterator[str]: ...
|
||||
def __next__(self) -> str: ...
|
||||
def fileno(self) -> int: ...
|
||||
def flush(self) -> None: ...
|
||||
def isatty(self) -> bool: ...
|
||||
def next(self) -> str: ...
|
||||
def read(self, n: int = ...) -> str: ...
|
||||
def readable(self) -> bool: ...
|
||||
def readline(self, limit: int = ...) -> str: ...
|
||||
def readlines(self, hint: int = ...) -> List[str]: ...
|
||||
def seek(self, offset: int, whence: int = ...) -> int: ...
|
||||
def seekable(self) -> bool: ...
|
||||
def tell(self) -> int: ...
|
||||
def truncate(self, size: Optional[int] = ...) -> int: ...
|
||||
def writable(self) -> bool: ...
|
||||
def write(self, s: str) -> int: ...
|
||||
def writelines(self, lines: Iterable[str]) -> None: ...
|
||||
|
||||
# It does not actually derive from IO[AnyStr], but it does implement the
|
||||
# protocol.
|
||||
class SpooledTemporaryFile(IO[AnyStr]):
|
||||
|
||||
Reference in New Issue
Block a user