Skip to content

add relative_deadline kwarg to CancelScope #908

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

Closed
1 task done
jakkdl opened this issue Apr 9, 2025 · 1 comment
Closed
1 task done

add relative_deadline kwarg to CancelScope #908

jakkdl opened this issue Apr 9, 2025 · 1 comment
Labels
enhancement New feature or request

Comments

@jakkdl
Copy link

jakkdl commented Apr 9, 2025

Things to check first

  • I have searched the existing issues and didn't find my feature already requested there

Feature description

Trio added the relative_deadline kwarg to CancelScope in python-trio/trio#3010 as part of resolving python-trio/trio#2512 (anyio's equivalent issue is #514).

Use case

Requesting this mostly to match Trio, and because I want to recommend it in flake8-async ASYNC125 constant-absolute-deadline https://flake8-async.readthedocs.io/en/latest/rules.html#async125

@jakkdl jakkdl added the enhancement New feature or request label Apr 9, 2025
@agronholm
Copy link
Owner

As discussed on Gitter, #514 can be resolved without adding this kwarg, by making move_on_after() a generator-based context manager like fail_after(). And I really don't like Trio's solution to the problem.

@agronholm agronholm closed this as not planned Won't fix, can't repro, duplicate, stale Apr 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants