[Python-Dev] Triple-quoted strings and indentation

Bob Ippolito bob at redivi.com
Mon Jul 11 07:08:16 CEST 2005


On Jul 10, 2005, at 6:39 PM, Josiah Carlson wrote:

>
> Andrew Durdin <adurdin at gmail.com> wrote:
>
>>
>> On 7/11/05, Josiah Carlson <jcarlson at uci.edu> 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 inherited from C, as well as unicode and  
> 'raw'
> strings" didn't make it into the final draft of that email.
>
> It is not as though you are taking something that used to be  
> invalid and
> making it valid, you are taking something that used to mean X and  
> making
> it mean Y.  Your proposed change /will/ cause incompatibility for some
> unknown number of modules which rely on the indentation of triple  
> quoted
> strings. You should realize that people get angry when their APIs  
> change
> the meaning of f(x), and you are asking for the language to do that.
> Have you a guess as to why you are getting resistance?

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.

-bob



More information about the Python-Dev mailing list