I would never use a quadruple quote for this if it were ever implemented. A better precedent would be a letter prefix to the quotes similar to what we do for raw strings and bytes constants today. m""" perhaps.
Daniel da Silva writes:We do.
> To me, this is rather ugly because it messes up the indentation of
> some_func(). Suppose we could have a multiline string, that when started on
> a line indented four spaces, ignores the first four spaces on each line of
> the literal when creating the actual string?
from textwrap import dedent
def some_func():val = dedent("""\
x, y = process_something()
<xml>I don't think the function call is ugly enough to fix with syntax.
<myThing>
<val>%s</val>
<otherVal>%s</otherVal>
</myThing>
</xml>
""") % (x, y)
return val
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
http://mail.python.org/mailman/listinfo/python-ideas