Skip to content

Create new ASYNC3xx rules to account for asyncio's different cancellation semantics? #257

Open
@Zac-HD

Description

@Zac-HD

In #211, we noted that ASYNC102 (await-in-finally-or-cancelled) is specific to Trio/AnyIO style "level-triggered" cancellation semantics.

Asyncio has a pretty different system, where cancellation is an event rather than a state (well, mostly - on Python 3.11+ there's also Task.uncancel() to reverse the state change, on 3.10 and earlier you can only partly uncancel).

If someone works out a good lint rule, or set of rules, for asyncio-style cancellation semantics, we'd be happy to accept them as ASYNC3xx rules and make ASYNC102 specific to Trio and AnyIO.

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions