[Python-Dev] String literal concatenation & docstrings

Carlos Ribeiro carribeiro at gmail.com
Sat Nov 27 04:53:48 CET 2004


On Fri, 26 Nov 2004 11:56:05 -0800, Brett C. <bac at ocf.berkeley.edu> wrote:
> Should probably change the wording on that unless people actually want the
> literal string concatenation to work with statements (docstrings seem like the
> only place that would be reasonable) unless you want to start allowing print
> statements to have a string part span multiple lines.  =)

It means that:

    print "this line continues"
          "on the next line"

does not work, while the following works:

    a = "this line continues"
        "on the next line"

Kind of weird, but anyway, that's not a common idiom. One more reason
to use triple-quoted-strings when printing long strings.

-- 
Carlos Ribeiro
Consultoria em Projetos
blog: http://rascunhosrotos.blogspot.com
blog: http://pythonnotes.blogspot.com
mail: carribeiro at gmail.com
mail: carribeiro at yahoo.com


More information about the Python-Dev mailing list