Improve tempfile.SpooledTemporaryFile (#7196)

This commit is contained in:
Alex Waygood
2022-02-14 01:41:54 +00:00
committed by GitHub
parent 65002d2e69
commit b0f2bd68b0

View File

@@ -295,7 +295,7 @@ class SpooledTemporaryFile(IO[AnyStr]):
def __enter__(self: Self) -> Self: ...
def __exit__(
self, exc_type: type[BaseException] | None, exc_val: BaseException | None, exc_tb: TracebackType | None
) -> bool | None: ...
) -> None: ...
# These methods are copied from the abstract methods of IO, because
# SpooledTemporaryFile implements IO.
# See also https://github.com/python/typeshed/pull/2452#issuecomment-420657918.
@@ -308,7 +308,7 @@ class SpooledTemporaryFile(IO[AnyStr]):
def readlines(self, hint: int = ...) -> list[AnyStr]: ...
def seek(self, offset: int, whence: int = ...) -> int: ...
def tell(self) -> int: ...
def truncate(self, size: int | None = ...) -> int: ...
def truncate(self, size: int | None = ...) -> None: ... # type: ignore[override]
def write(self, s: AnyStr) -> int: ...
def writelines(self, iterable: Iterable[AnyStr]) -> None: ...
def __iter__(self) -> Iterator[AnyStr]: ...