[Python-ideas] triple-quoted strings and indendation

Matthias Lehmann mat at matlehmann.de
Thu May 12 09:39:43 CEST 2011


> Wild idea: make the unary + operator on strings do
> textwrap.dedent() on them.
>
The disadvantage compared to a string flag is, that this unary operator 
has no knowledge of the current indendation level within the code - so 
this solution looks similar in code

x = +"""  foo
           bar"""

vs

x = t"""  foo
           bar"""

the results is different, though.

foo
bar

vs

   foo
   bar




More information about the Python-ideas mailing list