Skip to content
Merged
Changes from 4 commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
dea2e79
flake8-trio has been renamed
jakkdl May 22, 2024
d6e91cc
Add explicit documentation on timeout semantic for fail&move_on_after
jakkdl Jun 6, 2024
dc3bd3d
Merge branch 'master' into fail_after_documentation
jakkdl Jun 6, 2024
da25949
use a5rocks alternate phrasing for move_on_after
jakkdl Jun 7, 2024
7a8262a
add `relative_deadline` attribute to CancelScope. `move_on_after` and…
jakkdl Jun 20, 2024
d028037
Merge branch 'master' into fail_after_documentation
jakkdl Jun 20, 2024
5447f45
fix codecov, mypy now fails to unify return types across the timeouts…
jakkdl Jun 20, 2024
1381560
instead of a breaking change we now raise deprecationwarning and give…
jakkdl Jun 24, 2024
742c013
don't inherit from AbstractContextManager since that breaks 3.8, and …
jakkdl Jun 24, 2024
0075b56
fix RTD build. Replace star import with explicit list. Remove useless…
jakkdl Jun 24, 2024
9d3d0b9
reimplement as transforming class
jakkdl Jun 26, 2024
b29db0d
Merge branch 'master' into fail_after_documentation
jakkdl Jun 27, 2024
480681d
whoops, forgot to actually enter the cancelscope
jakkdl Jun 27, 2024
00ba1ca
Merge remote-tracking branch 'origin/main' into fail_after_documentation
jakkdl Aug 31, 2024
510aaa1
remove unneeded type:ignore with mypy 1.11
jakkdl Aug 31, 2024
7079d71
Merge branch 'main' into fail_after_documentation
jakkdl Sep 5, 2024
3474128
write docs, update newsfragments to match current implementation
jakkdl Sep 5, 2024
df5876d
add transitional functions
jakkdl Sep 5, 2024
a240948
fix test
jakkdl Sep 5, 2024
0183b43
fix tests/codecov
jakkdl Sep 5, 2024
ca63354
fix test
jakkdl Sep 5, 2024
7591297
Merge remote-tracking branch 'origin/main' into repro_pyright_verifyt…
jakkdl Sep 12, 2024
75fc52b
quick re-implementation after new spec. Docs/docstrings have not had …
jakkdl Sep 12, 2024
5a32eb0
clean up return type of fail_at/_after for sphinx
jakkdl Sep 16, 2024
c2a3d8e
remove _is_relative, and calculate it on the fly instead. Add nan han…
jakkdl Sep 16, 2024
f8e9417
change some RuntimeError to DeprecationWarning, fix tests/coverage
jakkdl Sep 16, 2024
36786a6
pragma: no cover
jakkdl Sep 16, 2024
8e863b8
Merge remote-tracking branch 'origin/main' into fail_after_documentation
jakkdl Sep 16, 2024
6a7650d
duplicate validation logic, bump pyright
jakkdl Sep 18, 2024
02ac588
Merge remote-tracking branch 'origin/main' into fail_after_documentation
jakkdl Sep 18, 2024
bf12a80
update docs/newsfragments/docstrings
jakkdl Sep 18, 2024
9961abc
properly link to ASYNC122
jakkdl Sep 19, 2024
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
5 changes: 4 additions & 1 deletion src/trio/_timeouts.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def move_on_at(deadline: float) -> trio.CancelScope:

def move_on_after(seconds: float) -> trio.CancelScope:
"""Use as a context manager to create a cancel scope whose deadline is
set to now + *seconds*.
set to creation time + *seconds*.

Args:
seconds (float): The timeout.
Expand Down Expand Up @@ -138,6 +138,9 @@ def fail_after(seconds: float) -> AbstractContextManager[trio.CancelScope]:
it's caught and discarded. When it reaches :func:`fail_after`, then it's
caught and :exc:`TooSlowError` is raised in its place.

The deadline of the cancel scope is calculated at creation time, not upon
entering the context manager.

Args:
seconds (float): The timeout.

Expand Down