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
As you pointed out: Whether the use of my_variable is unnecessary depends on if my_variable is already a string. Ruff's capability to detect this right now are very limited and I worry that the rule would have too many false-negatives (it couldn't flag an f-string like that if it can't determine the type of my_variable.
Description
Occasionally I have seen f-strings used like this:
In these instances, the f-string usage is improper because:
str(my_variable)
would be more Pythonic.I haven't seen a RUF rule to this effect, though I've seen a few other f-string rules. I think this would be a fine addition.
The text was updated successfully, but these errors were encountered: