implicit-str-concat / W1404#

Message emitted:

Implicit string concatenation found in %s


String literals are implicitly concatenated in a literal iterable definition : maybe a comma is missing ?

Problematic code:

x = ["a" "b"]  # [implicit-str-concat]

with open("hello.txt" "r") as f:  # [implicit-str-concat]

Correct code:

x = ["a", "b"]

with open("hello.txt", "r") as f:

Additional details:

By default, detection of implicit string concatenation of line jumps is disabled. Hence the following code will not trigger this rule:

SEQ = ('a', 'b'

In order to detect this case, you must enable check-str-concat-over-line-jumps:

check-str-concat-over-line-jumps = yes

However, the drawback of this setting is that it will trigger false positive for string parameters passed on multiple lines in function calls:

    "rotate() is deprecated and will be removed in a future release. "
    "Use the rotation() context manager instead.",

Related links:

Created by the string checker.