mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-20 19:01:15 +08:00
tempfile._TemporaryFileWrapper enhancements (#5519)
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user