[Python-ideas] triple-quoted strings and indendation

Matthias Lehmann mat at matlehmann.de
Fri May 13 16:13:57 CEST 2011


Am 13.05.2011 15:13, schrieb Stephen J. Turnbull:
> Matthias Lehmann writes:
>   >  >  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
>
> But then your complaint is against text.dedent, not against Python
> syntax.  (That's no reason you can't have 2 complaints, of course.)

Well, it's not the fault of textwrap.dedent, that is has no notion of 
the indendation-level of its argument. As far as I know, that is 
something, only the parser knows (not that I know anything about the 
Python parser).

Mat




More information about the Python-ideas mailing list