Skip to content
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

bpo-40816 Add AsyncContextDecorator class #20516

Merged
merged 12 commits into from
Nov 5, 2020
10 changes: 10 additions & 0 deletions Doc/library/contextlib.rst
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,16 @@ Functions and classes provided:

.. versionadded:: 3.7

:func:`asynccontextmanager` uses :class:`AsyncContextDecorator` so the context managers
it creates can be used as decorators as well as in :keyword:`async with` statements.
When used as a decorator, a new generator instance is implicitly created on
each function call (this allows the otherwise "one-shot" context managers
created by :func:`asynccontextmanager` to meet the requirement that context
managers support multiple invocations in order to be used as decorators).

.. versionchanged:: 3.10
heckad marked this conversation as resolved.
Show resolved Hide resolved
Use of :class:`AsyncContextDecorator`.
heckad marked this conversation as resolved.
Show resolved Hide resolved


.. function:: closing(thing)

Expand Down