Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
asvetlov merged 12 commits intopython:masterfromheckad:fix-issue-40816
Nov 5, 2020
Merged
Changes from1 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
PrevPrevious commit
Fix whitespaces
  • Loading branch information
@heckad
heckad committedOct 31, 2020
commit1bace398398b36ddc0be4dc063dcb27e0068e94e
12 changes: 6 additions & 6 deletionsDoc/library/contextlib.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -128,16 +128,16 @@ Functions and classes provided:

Context managers defined with :func:`asynccontextmanager` can be used
either as decorators or with :keyword:`async with` statements::

import time
async def timeit():

async def timeit():
now = time.monotonic()
try:
yield
finally:
print(f'it took {time.monotonic() - now}s to run')

@timeit()
async def main():
# ... async code ...
Expand DownExpand Up@@ -377,11 +377,11 @@ Functions and classes provided:


.. class:: AsyncContextManager

Similar as ContextManger only for async

Example of ``ContextDecorator``::

from asyncio import run
from contextlib import AsyncContextDecorator

Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp