[Python-ideas] Multi-line strings that respect indentation

Stephen J. Turnbull stephen at xemacs.org
Fri Nov 5 16:00:47 CET 2010


spir writes:

 > (Does dedent() base it's behaviour on first (non-empty) line?)

No, it chooses the longest common whitespace prefix in the whole
string.

I'm not sure what it does with blank lines.  A quick test ... in
Python 2.5.5, it ignores them for the purpose of determining the
dedent.  That is, you can have any amount of whitespace on a blank
line, but it doesn't affect the dedent computed.





More information about the Python-ideas mailing list