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
Closed
@Zac-HD

Description

@Zac-HD

#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().

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0