If you want a string with no line-feeds, you could
>>> x = (
... 'a very long string - part 1' +
... 'a very long string - part 2' +
... 'a very long string - part 3' )
>>> x
'a very long string - part 1a very long string - part 2a very long string - part 3'
>>>
The +
operator is not necessary with string literals:
2.4.2. String literal concatenation
Multiple adjacent string literals (delimited by whitespace), possibly using different quoting conventions, are allowed, and their meaning is the same as their concatenation. Thus, "hello" 'world' is equivalent to "helloworld". This feature can be used to reduce the number of backslashes needed, to split long strings conveniently across long lines, or even to add comments to parts of strings, for example:
re.compile("[A-Za-z_]" # letter or underscore
"[A-Za-z0-9_]*" # letter, digit or underscore
)
Your case:
>>> x = (
... 'a very long string - part 1'
... 'a very long string - part 2'
... 'a very long string - part 3' )
>>> x
'a very long string - part 1a very long string - part 2a very long string - part 3'
>>>