tempfile._TemporaryFileWrapper enhancements (#5519)

This commit is contained in:
Akuli
2021-05-25 16:30:08 +03:00
committed by GitHub
parent 4bfdba71cb
commit 55a2a180c6

View File

@@ -164,17 +164,16 @@ else:
) -> IO[Any]: ...
class _TemporaryFileWrapper(Generic[AnyStr], IO[AnyStr]):
file: IO[AnyStr]
name: Any
file: IO[AnyStr] # io.TextIOWrapper, io.BufferedReader or io.BufferedWriter
name: str
delete: bool
def __init__(self, file: IO[AnyStr], name: Any, delete: bool = ...) -> None: ...
def __init__(self, file: IO[AnyStr], name: str, delete: bool = ...) -> None: ...
def __enter__(self) -> _TemporaryFileWrapper[AnyStr]: ...
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.