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
[Autofix error] C408 - unnecessary-collection-call - syntax error when fixing within f-string #4249
Comments
Good call, thanks! |
(We track |
I think it's the braces and not the quotes as the quotes are taken as is. So, this should be avoided in |
Maybe the heuristics in the new |
I can work on it if nobody else wants to |
This fixes some C40* rules by adding spaces around dict and set literals inside f-string, and quotes correctly string literals inside f-string, since dict kwargs must be converted into string literals.
Presumably replacing
dict()
with{}
gets confused when inside an f-string when it comes to using"
vs'
(or maybe it's the nested{
)Using ruff 0.0.264
The text was updated successfully, but these errors were encountered: