.. _implicit-str-concat: implicit-str-concat / W1404 =========================== **Message emitted:** ``Implicit string concatenation found in %s`` **Description:** *String literals are implicitly concatenated in a literal iterable definition : maybe a comma is missing ?* **Problematic code:** ``list.py``: .. literalinclude:: /data/messages/i/implicit-str-concat/bad/list.py :language: python ``open.py``: .. literalinclude:: /data/messages/i/implicit-str-concat/bad/open.py :language: python **Correct code:** ``list.py``: .. literalinclude:: /data/messages/i/implicit-str-concat/good/list.py :language: python ``open.py``: .. literalinclude:: /data/messages/i/implicit-str-concat/good/open.py :language: python **Additional details:** By default, detection of implicit string concatenation of line jumps is disabled. Hence the following code will not trigger this rule: .. code-block:: python SEQ = ('a', 'b' 'c') In order to detect this case, you must enable `check-str-concat-over-line-jumps`: .. code-block:: toml [STRING_CONSTANT] check-str-concat-over-line-jumps = true However, the drawback of this setting is that it will trigger false positive for string parameters passed on multiple lines in function calls: .. code-block:: python warnings.warn( "rotate() is deprecated and will be removed in a future release. " "Use the rotation() context manager instead.", DeprecationWarning, stacklevel=3, ) No message will be emitted, though, if you clarify the wanted concatenation with parentheses: .. code-block:: python warnings.warn( ( "rotate() is deprecated and will be removed in a future release. " "Use the rotation() context manager instead." ), DeprecationWarning, stacklevel=3, ) Created by the `string `__ checker.