Are line continuations needed?

Dang Griffith noemail at noemail4u.com
Thu Apr 8 07:28:48 EDT 2004


On 8 Apr 2004 08:32:02 GMT, Duncan Booth <me at privacy.net> wrote:

...
>.... Consider 
>this (none of the lines are indented):
>
>mystring = """\
>+---------------+
>|    '"         |
>+---------------+
>"""
>
>Without a line continuation there simply isn't any way to write this string 
>and still have the box characters line up neatly.

Ok, I'll bite...

mystring = (
"""+---------------+\n"""
"""|    '"         |\n"""
"""+---------------+"""
)

    --dang
p.s.
I'm not saying it's as pretty, just that there simply is a way to
write the string and still have the box characters line up neatly,
and it's not too heinous.



More information about the Python-list mailing list