Skip to content

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

z = "The quick " "brown fox."

Use instead:

z = "The quick brown fox."

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:

  1. Run the linter with this rule (ISC001) disabled
  2. Run the formatter
  3. 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.