We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
len(x) > 0
This suggestion changes the resulting code:
x = "" is_negative = len(x) > 0 and x[0] == "-" # Output: False # Violates [FURB115]: Use `x` instead of `len(x) > 0` x = "" is_negative = x and x[0] == "-" # Output: ""
The text was updated successfully, but these errors were encountered:
Yes, this is most definitely a bug. Refurb should check to make sure that x is being used in a situation where a bool is expected, like an if block.
x
if
Thank you for reporting this!
Sorry, something went wrong.
dosisod
Successfully merging a pull request may close this issue.
This suggestion changes the resulting code:
The text was updated successfully, but these errors were encountered: