python-trio / python-trio/flake8-async
Create new `ASYNC3xx` rules to account for asyncio's different cancellation semantics?
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 26
- Forks
- 10
- PR merge metrics
- No merged PRs in 30d
Description
In https://github.com/python-trio/flake8-async/issues/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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading issue 211, the existing ASYNC102 rule, and the linked asyncio cancellation documentation. Work out a well-defined ASYNC3xx rule or rule set for asyncio's cancellation semantics, then confirm that ASYNC102 can remain specific to Trio and AnyIO and that the proposed rules are suitable for acceptance.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100