flake8-simplify
flake8-simplify copied to clipboard
Use repr when printing strings
Desired change
- Rule(s): SIM300 (However it likely affects more rules)
- Adjustment: Use repr when printing the strings
Explanation
With an if statement like this:
if "}\n" == line:
...
the current version of flake8-simplify prints the }\n
string with an actual new line, instead of escaping the special newline character, like doing repr("}\n")
would. This looks very weird, and many editors don't support it and only print the first line, which is misleading: