[Python-ideas] Implicit string literal concatenation considered harmful?

Andrew Barnert abarnert at yahoo.com
Sat May 11 07:05:55 CEST 2013


On May 10, 2013, at 20:50, Mark Janssen <dreamingforward at gmail.com> wrote:

>> Maybe we could turn ... into a "string continuation
>> operator":
>> 
>>   print("This is example %d of a line that is "...
>>         "too long" % example_number)
> 
> I think that is an awesome idea.

How is this any better than + in the same position? It's harder to notice, and longer (remember that the only reason you're doing this is that you can't fit your strings into 80 cols).

Also, this gives two ways to do it, that have the exact same effect when they're both legal. The only difference is that the new way is only legal in a restricted set of cases.

By the way, is it just a coincidence that almost all of the people sticking up for keeping or replacing implicit concatenation instead of just scrapping it are using % formatting in their examples?


More information about the Python-ideas mailing list