[Python-Dev] String concatenation

Barry Scott barry at barrys-emacs.org
Sat Aug 9 00:26:43 CEST 2008

On Aug 3, 2008, at 19:12, Stavros Korokithakis wrote:

> Hmm, thanks, although I don't see why it was rejected, since it  
> seems to me that by using the addition operator or triple-quoting  
> all the use cases would become clearer and not significantly harder  
> to write, while the (often silent) errors would not happen any more.

I use this feature all the time in preference to triple quote strings  
to allow the indenting structure to be preserved.

def I_like_this():
	s = ("a multi line\n"
                "that keeps the indent of the function")

def I_do_not_like_this():
	s = '''a multi line
that break the indent of the function"


More information about the Python-Dev mailing list