Re: Triple-quoted strings hath not the Python-nature

2008-10-27 Thread Steven D'Aprano
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

Re: Triple-quoted strings hath not the Python-nature

2008-10-26 Thread Mel
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 >

Re: Triple-quoted strings hath not the Python-nature

2008-10-26 Thread Lawrence D'Oliveiro
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

Re: Triple-quoted strings hath not the Python-nature

2008-10-26 Thread Lawrence D'Oliveiro
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

Re: Triple-quoted strings hath not the Python-nature

2008-10-22 Thread Steven D'Aprano
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

Re: Triple-quoted strings hath not the Python-nature

2008-10-21 Thread Asun Friere
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

Re: Triple-quoted strings hath not the Python-nature

2008-10-21 Thread Robert Lehmann
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

Re: Triple-quoted strings hath not the Python-nature

2008-10-21 Thread Orestis Markou
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:

Triple-quoted strings hath not the Python-nature

2008-10-21 Thread Lawrence D'Oliveiro
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