-
Notifications
You must be signed in to change notification settings - Fork 881
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TRIO115 false positive with with sleep(var)
where var
starts as 0
#9935
Comments
Thanks. I don't think this has been "fixed" in |
We could consider doing the same, or just check if the variable is ever re-bound to something else. |
sleep(var)
where var
starts as 0
(already fixed in flake8-trio
- ruff is out of date)sleep(var)
where var
starts as 0
@charliermarsh Oh, I see - you're correct. Not flagging on a non-constant sounds reasonable to me. With a variable, even if not re-bound, it seems like the developer is signaling that it's considered changeable in at least some sense. |
Agreed. |
flake8-trio dev here: |
As #10376 is merged, it looks like this issue could be closed. |
Ruff 0.2.1
The following snippet illustrates a TRIO115 false positive when
sleep()
is passed a variable whose initial value was0
, but changes later in a loop construct. Similar to #9934, this is already fixed inflake8-trio
. This seems to be strongly indicating that recent fixes toflake8-trio
need to be ported in general.The text was updated successfully, but these errors were encountered: