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

Alexander Belopolsky alexander.belopolsky at gmail.com
Fri May 10 21:26:10 CEST 2013


On Fri, May 10, 2013 at 2:48 PM, Guido van Rossum <guido at python.org> wrote:

> I just spent a few minutes staring at a bug caused by a missing comma
> -- I got a mysterious argument count error because instead of foo('a',
> 'b') I had written foo('a' 'b').


I had a similar experience just few weeks ago.  The bug was in a long list
written like this:

['item11', 'item12', ..., 'item17',
 'item21', 'item22', ..., 'item27'
 ...
 'item91', 'item92', ..., 'item97']

Clearly the bug crept in when more items were added.   (I try to keep
redundant commas at the end of the list to avoid this, but not everyone
likes this style.)

>
>
Would it be reasonable to start deprecating this and eventually remove
> it from the language?
>

+1, but I would start by requiring () around concatenated strings.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20130510/efac1ef9/attachment.html>


More information about the Python-ideas mailing list