single-line-implicit-string-concatenation (ISC001)
Derived from the flake8-implicit-str-concat linter.
Fix is sometimes available.
What it does
Checks for implicitly concatenated strings on a single line.
Why is this bad?
While it is valid Python syntax to concatenate multiple string or byte literals implicitly (via whitespace delimiters), it is unnecessary and negatively affects code readability.
In some cases, the implicit concatenation may also be unintentional, as code formatters are capable of introducing single-line implicit concatenations when collapsing long lines.
Example
Use instead:
Formatter compatibility
Use of this rule alongside the formatter must be handled with care. Currently, the formatter can introduce new single-line implicitly concatenated strings, therefore we suggest rerunning the linter and formatter in the following order:
- Run the linter with this rule (
ISC001
) disabled - Run the formatter
- Rerun the linter with this rule (
ISC001
) enabled
This is one of very few cases where the formatter can produce code that contains lint violations. It is a known issue that should be resolved by the new 2025 style guide.