trio-unneeded-sleep (TRIO110)#
Derived from the flake8-trio linter.
This rule is unstable and in preview. The --preview
flag is required for use.
What it does#
Checks for the use of trio.sleep
in a while
loop.
Why is this bad?#
Instead of sleeping in a while
loop, and waiting for a condition
to become true, it's preferable to wait()
on a trio.Event
.
Example#
Use instead: