Skip to content

Fix AiofilesContextManagerTempDir type argument #14349

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
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
3 changes: 1 addition & 2 deletions stubs/aiofiles/aiofiles/tempfile/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ from typing import AnyStr, Literal, overload
from ..base import AiofilesContextManager
from ..threadpool.binary import AsyncBufferedIOBase, AsyncBufferedReader, AsyncFileIO
from ..threadpool.text import AsyncTextIOWrapper
from .temptypes import AsyncTemporaryDirectory

# Text mode: always returns AsyncTextIOWrapper
@overload
Expand Down Expand Up @@ -318,7 +317,7 @@ def TemporaryDirectory(
executor=None,
) -> AiofilesContextManagerTempDir: ...

class AiofilesContextManagerTempDir(AiofilesContextManager[AsyncTemporaryDirectory]):
class AiofilesContextManagerTempDir(AiofilesContextManager[str]):
async def __aenter__(self) -> str: ... # type: ignore[override]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the # type: ignore still needed?

Suggested change
async def __aenter__(self) -> str: ... # type: ignore[override]
async def __aenter__(self) -> str: ...


__all__ = ["NamedTemporaryFile", "TemporaryFile", "SpooledTemporaryFile", "TemporaryDirectory"]