8000 bpo-40816 Add AsyncContextDecorator class by heckad · Pull Request #20516 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content
8000

bpo-40816 Add AsyncContextDecorator class #20516

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

Merged
merged 12 commits into from
Nov 5, 2020
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
Prev Previous commit
Next Next commit
Improve doc
  • Loading branch information
heckad committed Jul 26, 2020
commit 81df65c31556f5ac39ba07223faeca31bce973fe
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
Use of :class:`AsyncContextDecorator`.


.. function:: closing(thing)

Expand Down
0