Steven Bethard a écrit :
> On 5/2/07, Michael Foord <[EMAIL PROTECTED]> wrote:
>> Implicit string concatenation is massively useful for creating long
>> strings in a readable way though:
>>
>>     call_something("first part\n"
>>                            "second line\n"
>>                             "third line\n")
>>
>> I find it an elegant way of building strings and would be sad to see it
>> go. Adding trailing '+' signs is ugly.
> 
> You'll still have textwrap.dedent::
> 
>     call_something(dedent('''\
>         first part
>         second line
>         third line
>         '''))
> 
> And using textwrap.dedent, you don't have to remember to add the \n at
> the end of every line.
> 
> STeVe

maybe we could have a "dedent" literal that would remove the first newline and
all indentation so that you can just write:

call_something( d'''
                 first part
                 second line
                 third line
                 ''' )

Cheers
Baptiste

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to