Skip to content

Commit c6534ee

Browse files
committed
Add note on type argument inference
1 parent d179fa9 commit c6534ee

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

stdlib/contextlib.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ class _GeneratorContextManagerBase(Generic[_G_co]):
8888
class _GeneratorContextManager(
8989
_GeneratorContextManagerBase[Generator[_T_co, _SendT_contra, _ReturnT_co]],
9090
AbstractContextManager[_T_co, bool | None],
91-
ContextDecorator[_ExcReturnT],
91+
ContextDecorator[_ExcReturnT], # _ExcReturnT is inferred by the type checker
9292
):
9393
def __exit__(
9494
self, typ: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None
@@ -105,7 +105,7 @@ if sys.version_info >= (3, 10):
105105
class _AsyncGeneratorContextManager(
106106
_GeneratorContextManagerBase[AsyncGenerator[_T_co, _SendT_contra]],
107107
AbstractAsyncContextManager[_T_co, bool | None],
108-
AsyncContextDecorator[_ExcReturnT],
108+
AsyncContextDecorator[_ExcReturnT], # _ExcReturnT is inferred by the type checker
109109
):
110110
async def __aexit__(
111111
self, typ: type[BaseException] | None, value: BaseException | None, traceback: TracebackType | None

0 commit comments

Comments
 (0)