Ruff 0.2.1
The following snippet illustrates a TRIO115 false positive when sleep() is passed a variable whose initial value was 0, but changes later in a loop construct. Similar to #9934, this is already fixed in flake8-trio. This seems to be strongly indicating that recent fixes to flake8-trio need to be ported in general.
import trio
async def main() -> None:
sleep = 0
for _ in range(2):
# ↓↓↓↓↓ TRIO115 [*] Use `trio.lowlevel.checkpoint()` instead of `trio.sleep(0)`
await trio.sleep(sleep)
sleep = 10
trio.run(main)