Skip to content

Commit

Permalink
Add _recreate_cm to ContextDecorator and AsyncContextDecorator (p…
Browse files Browse the repository at this point in the history
  • Loading branch information
max-muoto authored Aug 10, 2024
1 parent 9045c67 commit b406ba9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions stdlib/contextlib.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class AbstractAsyncContextManager(Protocol[_T_co, _ExitT_co]):
) -> _ExitT_co: ...

class ContextDecorator:
def _recreate_cm(self) -> Self: ...
def __call__(self, func: _F) -> _F: ...

class _GeneratorContextManager(AbstractContextManager[_T_co, bool | None], ContextDecorator):
Expand All @@ -80,6 +81,7 @@ if sys.version_info >= (3, 10):
_AF = TypeVar("_AF", bound=Callable[..., Awaitable[Any]])

class AsyncContextDecorator:
def _recreate_cm(self) -> Self: ...
def __call__(self, func: _AF) -> _AF: ...

class _AsyncGeneratorContextManager(AbstractAsyncContextManager[_T_co, bool | None], AsyncContextDecorator):
Expand Down

0 comments on commit b406ba9

Please sign in to comment.