On Fri, 05 Nov 2010 10:10:14 +0900 "Stephen J. Turnbull" email@example.com wrote:
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 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(): x, y = process_something()
val = dedent("""\ <xml> <myThing> <val>%s</val> <otherVal>%s</otherVal> </myThing> </xml> """) % (x, y) return val
I don't think the function call is ugly enough to fix with syntax.
It's just reversing the point of view. The right thing would be to have Python code correctly aligned on indentation _by default_. And possibly provide an alternative for cases (which?) where one would want indent not taken into account.
-- -- -- -- -- -- -- vit esse estrany ☣