You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The SIM208 rule should be updated to only emit errors for not not x in boolean contexts, since changing it to just x can cause different results under certain circumstances.
Example
x=123y=notnotx
In the above example, y is True, but changing it to y = x turns it into 123.
Solution
Only check when in a boolean context, such as an if/while clause:
x= ... # dont check hereifx: # ok to check
...
elifx: # and here
...
eliff(x): # but not here!
...
The text was updated successfully, but these errors were encountered:
The
SIM208
rule should be updated to only emit errors fornot not x
in boolean contexts, since changing it to justx
can cause different results under certain circumstances.Example
In the above example,
y
isTrue
, but changing it toy = x
turns it into123
.Solution
Only check when in a boolean context, such as an
if
/while
clause:The text was updated successfully, but these errors were encountered: