Skip to content

bpo-46771: Implement asyncio context managers for handling timeouts #31394

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 31 commits into from
Mar 10, 2022
Merged
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
dac5874
bpo-46771: Implement asyncio context managers for handling timeouts
asvetlov Mar 2, 2022
374ff2a
Add reschedule tests
asvetlov Mar 2, 2022
70fa59b
Add reschedule tests
asvetlov Mar 2, 2022
3ae2af6
Dro breakpoint
asvetlov Mar 2, 2022
1654ec4
Tune repr
asvetlov Mar 2, 2022
2c9dbf8
Add tests
asvetlov Mar 2, 2022
baa7400
More tests
asvetlov Mar 2, 2022
1ca0fb8
Rename
asvetlov Mar 2, 2022
8a81dd1
Update Lib/asyncio/timeouts.py
asvetlov Mar 8, 2022
fae235d
Update Lib/asyncio/timeouts.py
asvetlov Mar 8, 2022
663b82f
Update Lib/asyncio/timeouts.py
asvetlov Mar 8, 2022
24d62d1
Update Lib/asyncio/timeouts.py
asvetlov Mar 8, 2022
6a26d1b
Add a test
asvetlov Mar 8, 2022
930b92b
Polish docstrings
asvetlov Mar 8, 2022
ac5c53d
Format
asvetlov Mar 8, 2022
f96ad1c
Tune tests
asvetlov Mar 8, 2022
94b4b4c
Fix comment
asvetlov Mar 8, 2022
388c6da
Tune comment
asvetlov Mar 8, 2022
cdc7f88
Tune docstrings
asvetlov Mar 8, 2022
9949fe4
Tune
asvetlov Mar 8, 2022
c716856
Tune tests
asvetlov Mar 8, 2022
b4889a0
Update Lib/test/test_asyncio/test_timeouts.py
asvetlov Mar 8, 2022
b6504e6
Tune tests
asvetlov Mar 8, 2022
fd2688d
Don't clobber foreign exceptions even if timeout is expiring
gvanrossum Mar 9, 2022
2ddda69
Add test from discussion
gvanrossum Mar 9, 2022
493545a
Fix indent of added test
gvanrossum Mar 9, 2022
ff36f2a
Disable slow callback warning
asvetlov Mar 9, 2022
8790e49
Reformat
asvetlov Mar 9, 2022
ac6f8c8
Increase delay
asvetlov Mar 9, 2022
e8c67ce
Don't raise TimeoutError if the CancelledError was swallowed by inner…
asvetlov Mar 9, 2022
e65d766
Don't duplicate py/c tests, timeout has no C accelerators
asvetlov Mar 10, 2022
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
Update Lib/asyncio/timeouts.py
Co-authored-by: Guido van Rossum <guido@python.org>
  • Loading branch information
asvetlov and gvanrossum committed Mar 9, 2022
commit 24d62d11d455fa7f6e05ea32a387633297b03466
2 changes: 1 addition & 1 deletion Lib/asyncio/timeouts.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def timeout(delay: Optional[float]) -> Timeout:
Useful in cases when you want to apply timeout logic around block
of code or in cases when asyncio.wait_for is not suitable. For example:

>>> with timeout(10): # 10 seconds timeout
>>> async with timeout(10): # 10 seconds timeout
... await long_running_task()


Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy