8000 False alarm from recent `ASYNC100` change · Issue #325 · python-trio/flake8-async · GitHub
[go: up one dir, main page]

Skip to content

False alarm from recent ASYNC100 change #325

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
Zac-HD opened this issue Nov 18, 2024 · 0 comments · Fixed by #327
Closed

False alarm from recent ASYNC100 change #325

Zac-HD opened this issue Nov 18, 2024 · 0 comments · Fixed by #327
Assignees
Labels
bug Something isn't working

Comments

@Zac-HD
Copy link
Member
Zac-HD commented Nov 18, 2024

#317 goes a little too far: while the Nursery.__aexit__ method is not itself a cancel point, if we've nursery.start_soon()'d any tasks, we should presume that they do contain cancel points and thus avoid raising ASYNC100. demo:

import time, trio

@trio.run
async def main():
    with trio.fail_after(0.1):  # raises TooSlowError despite ASYNC100 lint
        async with trio.open_nursery() as n:
            time.sleep(1)  # noqa
            n.start_soon(trio.lowlevel.checkpoint)

As a quick workaround, it'd be good to remove the special handling for nurseries/taskgroups; longer term we could bring it back only for nurseries that don't contain a .start_soon().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants
0