8000 Tighten tempfile() return types by srittau · Pull Request #10232 · python/typeshed · GitHub
[go: up one dir, main page]

Skip to content

Tighten tempfile() return types #10232

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jun 8, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix return type
  • Loading branch information
srittau committed May 31, 2023
commit 48177f6bccfd19d4f7612eb7d0386c9788828267
6 changes: 3 additions & 3 deletions stdlib/tempfile.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ from _typeshed import (
)
from collections.abc import Iterable, Iterator
from types import TracebackType
from typing import IO, Any, AnyStr, BinaryIO, Generic, overload
from typing import IO, Any, AnyStr, Generic, overload
from typing_extensions import Literal, Self, TypeAlias

if sys.version_info >= (3, 9):
Expand Down Expand Up @@ -195,7 +195,7 @@ else:
dir: GenericPath[AnyStr] | None = None,
*,
errors: str | None = None,
) -> BinaryIO: ...
) -> IO[Any]: ...
else:
@overload
def TemporaryFile(
Expand Down Expand Up @@ -256,7 +256,7 @@ else:
suffix: AnyStr | None = ...,
prefix: AnyStr | None = ...,
dir: GenericPath[AnyStr] | None = ...,
) -> BinaryIO: ...
) -> IO[Any]: ...

class _TemporaryFileWrapper(Generic[AnyStr], IO[AnyStr]):
file: IO[AnyStr] # io.TextIOWrapper, io.BufferedReader or io.BufferedWriter
Expand Down
0