[Python-Dev] String concatenation

Stavros Korokithakis stavros at korokithakis.net
Sun Aug 3 20:12:14 CEST 2008

Hmm, thanks, although I don't see why it was rejected, since it seems to 
me that by using the addition operator or triple-quoting all the use 
cases would become clearer and not significantly harder to write, while 
the (often silent) errors would not happen any more.

The PEP only mentions that "the feature to be removed isn't all that 
harmful, and there are some use cases that would become harder", but I'm 
not sure that the "harder use cases" (which ones?) justify the error 

Stavros Korokithakis

Michael Foord wrote:
> Stavros Korokithakis wrote:
>> Hello,
>> is concatenation of adjacent strings a useful feature? So far the only 
>> use case I've seen is causing me endless hours of debugging when I 
>> forget the comma in a tuple of strings, like so:
>> ("first",
>>  "second"
>>  "third")
>> Which then becomes a tuple of two items, instead of three. It would 
>> have been much better if it produced an error. Is there any good 
>> reason that this feature exists, or would it be better if it were 
>> removed?
> It can be a very useful feature.
> See the rejected PEP 3126 for a discussion:
> http://www.python.org/dev/peps/pep-3126/
> Michael Foord
>> Regards,
>> Stavros Korokithakis
>> _______________________________________________
>> Python-Dev mailing list
>> Python-Dev at python.org
>> http://mail.python.org/mailman/listinfo/python-dev
>> Unsubscribe: 
>> http://mail.python.org/mailman/options/python-dev/fuzzyman%40voidspace.org.uk 

More information about the Python-Dev mailing list