From a81c0d98ae8bd2b846592f6cc26d4d9911964a8b Mon Sep 17 00:00:00 2001 From: sean-anderson-seco <74551845+sean-anderson-seco@users.noreply.github.com> Date: Thu, 27 Feb 2025 18:44:56 -0500 Subject: [PATCH] Fix type of closing Entering the `contextlib.closing` context manager returns its argument, not an instance of `contextlib.closing` itself. --- asyncstdlib/contextlib.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/asyncstdlib/contextlib.pyi b/asyncstdlib/contextlib.pyi index 26a71b4..9170b67 100644 --- a/asyncstdlib/contextlib.pyi +++ b/asyncstdlib/contextlib.pyi @@ -60,7 +60,7 @@ def contextmanager( class closing(Generic[AClose]): def __init__(self, thing: AClose) -> None: ... - async def __aenter__(self: Self) -> Self: ... + async def __aenter__(self: Self) -> AClose: ... async def __aexit__( self, exc_type: type[BaseException] | None,