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.
I'm -0.5 on this.
I don't think it is a necessary feature thanks to the textwrap.dedent. But the reason I'm not -1 is that using dedent incurs runtime cost to process the larger string constant to generate the desired one. The best way around this is to declare your large string constants at the module level where you don't need to worry about dedent at all.
On Thu, Nov 4, 2010 at 6:10 PM, Stephen J. Turnbull firstname.lastname@example.org:
Daniel da Silva writes:
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
a line indented four spaces, ignores the first four spaces on each line
the literal when creating the actual string?
from textwrap import dedent def some_func(): x, y = process_something()
val = dedent("""\ <xml> <myThing> <val>%s</val> <otherVal>%s</otherVal> </myThing>
</xml> """) % (x, y)
I don't think the function call is ugly enough to fix with syntax. _______________________________________________ Python-ideas mailing list Pythonemail@example.com http://mail.python.org/mailman/listinfo/python-ideas