Skip to content
Merged
Changes from 1 commit
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
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
Comment thread
heckad marked this conversation as resolved.
Use of :class:`AsyncContextDecorator`.
Comment thread
heckad marked this conversation as resolved.
Outdated


.. function:: closing(thing)

Expand Down