Re: [Python-Dev] Triple-quoted strings and indentation

2005-07-11 Thread M.-A. Lemburg
Bob Ippolito wrote: A better proposal would probably be another string prefix that means dedent, but I'm still not sold. doc processing software is clearly going to have to know how to dedent anyway in order to support existing code. Agreed. It is easy enough for any doc-string

Re: [Python-Dev] Triple-quoted strings and indentation

2005-07-11 Thread Barry Warsaw
On Mon, 2005-07-11 at 01:08, Bob Ippolito wrote: A better proposal would probably be another string prefix that means dedent, but I'm still not sold. doc processing software is clearly going to have to know how to dedent anyway in order to support existing code. OTOH, adding another

Re: [Python-Dev] Triple-quoted strings and indentation

2005-07-10 Thread Andrew Durdin
On 7/6/05, Nick Coghlan [EMAIL PROTECTED] wrote: However, while I prefer what you describe to Python's current behaviour, I am not yet convinced the backward compatibility pain is worth it. Adding yet-another-kind-of-string-literal (when we already have bytestrings on the horizon) is also

Re: [Python-Dev] Triple-quoted strings and indentation

2005-07-10 Thread Andrew Durdin
On 7/7/05, Guido van Rossum [EMAIL PROTECTED] wrote: I don't think so. It smells too much of DWIM, which is very unpythonic. EIBTI. In what way? The scheme described is explicit, and consistently applied to all triple-quoted strings[*] -- although the rules are different to the current

Re: [Python-Dev] Triple-quoted strings and indentation

2005-07-10 Thread Andrew Durdin
On 7/7/05, Terry Reedy [EMAIL PROTECTED] wrote: I believe there were some current alternatives and concerns already expressed that have not been included yet that maybe should be. Yes; Nick pointed me to one, and I'll be looking at that and the related discussions before redrafting; I'll also

Re: [Python-Dev] Triple-quoted strings and indentation

2005-07-10 Thread Reinhold Birkenfeld
Guido van Rossum wrote: On 7/5/05, Andrew Durdin [EMAIL PROTECTED] wrote: I have written a patch that changes the way triple-quoted strings are scanned so that leading whitespace is ignored in much the same way that pep 257 handles it for docstrings. Largely this was for a learning experience

Re: [Python-Dev] Triple-quoted strings and indentation

2005-07-10 Thread Josiah Carlson
Andrew Durdin [EMAIL PROTECTED] wrote: On 7/7/05, Guido van Rossum [EMAIL PROTECTED] wrote: I don't think so. It smells too much of DWIM, which is very unpythonic. EIBTI. In what way? The scheme described is explicit, and consistently applied to all triple-quoted strings[*] --

Re: [Python-Dev] Triple-quoted strings and indentation

2005-07-10 Thread Guido van Rossum
On 7/10/05, Andrew Durdin [EMAIL PROTECTED] wrote: On 7/7/05, Guido van Rossum [EMAIL PROTECTED] wrote: I don't think so. It smells too much of DWIM, which is very unpythonic. EIBTI. In what way? The scheme described is explicit, and consistently applied to all triple-quoted strings[*]

Re: [Python-Dev] Triple-quoted strings and indentation

2005-07-10 Thread Andrew Durdin
On 7/11/05, Josiah Carlson [EMAIL PROTECTED] wrote: You are wrong. Current string literals are explicit. They are what you type. No they are not: I typed \x41, but got this! 'I typed A, but got this!' What we have are not explicit string literals but *explicit rules*, forming part

Re: [Python-Dev] Triple-quoted strings and indentation

2005-07-10 Thread Josiah Carlson
Andrew Durdin [EMAIL PROTECTED] wrote: On 7/11/05, Josiah Carlson [EMAIL PROTECTED] wrote: You are wrong. Current string literals are explicit. They are what you type. No they are not: Apparently my disclaimer of except in the case of the decades-old string escapes that were

Re: [Python-Dev] Triple-quoted strings and indentation

2005-07-10 Thread Bob Ippolito
On Jul 10, 2005, at 6:39 PM, Josiah Carlson wrote: Andrew Durdin [EMAIL PROTECTED] wrote: On 7/11/05, Josiah Carlson [EMAIL PROTECTED] wrote: You are wrong. Current string literals are explicit. They are what you type. No they are not: Apparently my disclaimer of except in

Re: [Python-Dev] Triple-quoted strings and indentation

2005-07-10 Thread Terry Reedy
Andrew Durdin [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Very likely. But given the number of times that similar proposals have been put forth in the past, it is reasonable to expect that they will be brought up again in the future by others, if this is rejected--and in that

Re: [Python-Dev] Triple-quoted strings and indentation

2005-07-06 Thread Terry Reedy
Andrew Durdin [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] In general, I find triple-quoted strings to be very handy, particularly for standalone scripts. However, the fact that they have to be written in the left-hand column to avoid leading whitespace really grates,

Re: [Python-Dev] Triple-quoted strings and indentation

2005-07-06 Thread Andrew Durdin
On 7/6/05, Terry Reedy [EMAIL PROTECTED] wrote: Doc strings, first meant for the code reader, need to be where they are. They also come before the code itself, so don't interfere. Doc strings are really not an issue, due to the conventions for processing whitespace in them (and also the fact

Re: [Python-Dev] Triple-quoted strings and indentation

2005-07-06 Thread Andrew Durdin
Here's the draft PEP I wrote up: Abstract Triple-quoted string (TQS henceforth) literals in Python preserve the formatting of the literal string including newlines and whitespace. When a programmer desires no leading whitespace for the lines in a TQS, he must align all lines

Re: [Python-Dev] Triple-quoted strings and indentation

2005-07-06 Thread Guido van Rossum
On 7/5/05, Andrew Durdin [EMAIL PROTECTED] wrote: I have written a patch that changes the way triple-quoted strings are scanned so that leading whitespace is ignored in much the same way that pep 257 handles it for docstrings. Largely this was for a learning experience in hacking the parser,

[Python-Dev] Triple-quoted strings and indentation

2005-07-05 Thread Andrew Durdin
In general, I find triple-quoted strings to be very handy, particularly for standalone scripts. However, the fact that they have to be written in the left-hand column to avoid leading whitespace really grates, particularly when they're nested within a block or two -- it's a wart: try:

Re: [Python-Dev] Triple-quoted strings and indentation

2005-07-05 Thread Steven Bethard
On 7/5/05, Andrew Durdin [EMAIL PROTECTED] wrote: print Usage: dostuff options Options: -c - blah blah -f filename - do stuff with file filename -s - more blah Isn't the standard idiom for this already: import textwrap ... print textwrap.dedent(\ Usage:

Re: [Python-Dev] Triple-quoted strings and indentation

2005-07-05 Thread Terry Reedy
Andrew Durdin [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] In general, I find triple-quoted strings to be very handy, particularly for standalone scripts. However, the fact that they have to be written in the left-hand column to avoid leading whitespace really grates,