PEP8 suggests a line limit of 80 characters. But my string goes over the limit:
s = "this is my really, really, really, really, really, really, really long string that I'd like to shorten."
How should I format that to stay within the character limit? e.g.,
s = (
"this is my really, really, really, really, really, really" +
"really long string that I'd like to shorten."
)
Implicit concatenation might be the cleanest solution:
s = "this is my really, really, really, really, really, really," \
" really long string that I'd like to shorten."
Edit On reflection I agree that Todd's suggestion to use brackets rather than line continuation is better for all the reasons he gives. The only hesitation I have is that it's relatively easy to confuse bracketed strings with tuples.