On Mon, 27 Oct 2008 12:11:34 +1300, Lawrence D'Oliveiro wrote:
> In message <[EMAIL PROTECTED]>, Steven D'Aprano
> wrote:
>
>> I disagree. Triple-quoted strings are exactly the same as other
>> strings: they capture *exactly* what you put in them ...
>
> But that conflicts with the use of whites
Lawrence D'Oliveiro wrote:
> In message <[EMAIL PROTECTED]>, Steven D'Aprano
> wrote:
>
>> I disagree. Triple-quoted strings are exactly the same as other strings:
>> they capture *exactly* what you put in them ...
>
> But that conflicts with the use of whitespace for indentation rules. Other
>
In message <[EMAIL PROTECTED]>, Robert Lehmann
wrote:
> I would feel greatly offended if I had to indent all *raw* data.
You mean raw strings?
--
http://mail.python.org/mailman/listinfo/python-list
In message <[EMAIL PROTECTED]>, Steven D'Aprano
wrote:
> I disagree. Triple-quoted strings are exactly the same as other strings:
> they capture *exactly* what you put in them ...
But that conflicts with the use of whitespace for indentation rules. Other
languages are freeform, and have strings t
On Tue, 21 Oct 2008 21:58:57 +1300, Lawrence D'Oliveiro wrote:
> If triple-quoted strings had the Python-nature, then they would take
> indentation into account. Thus:
>
> """this
> is a
> multi-line
> string."""
>
> would be equivalent to
>
> "this\n is a\n multi-line\nst
That should be "Triple-quoted strings HAVE not the Python-nature."
'Hath' is the archaic 3rd person SINGULAR form of 'to have,' as in "a
tripple-quoted string hath ..."
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, 21 Oct 2008 21:58:57 +1300, Lawrence D'Oliveiro wrote:
> If triple-quoted strings had the Python-nature, then they would take
> indentation into account. Thus:
>
> """this
> is a
> multi-line
> string."""
>
> would be equivalent to
>
> "this\n is a\n multi-line\nst
from textwrap import dedent
dedent("""\
this
is a
multi-line
string.""")
will do what you want
On Tue, Oct 21, 2008 at 9:58 AM, Lawrence D'Oliveiro
<[EMAIL PROTECTED]> wrote:
> If triple-quoted strings had the Python-nature, then they would take
> indentation into account. Thus:
If triple-quoted strings had the Python-nature, then they would take
indentation into account. Thus:
"""this
is a
multi-line
string."""
would be equivalent to
"this\n is a\n multi-line\nstring."
and not
"this\n is a\n multi-line\nstring."
The rule would b