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

Stefan Behnel stefan_ml at behnel.de
Sat May 11 11:42:31 CEST 2013


Ezio Melotti, 10.05.2013 22:40:
> ['this is a '
>  'long string',
>  'this is another '
>  'long string']
> I agree that requiring extra (...) in this case is reasonable, i.e.:
> [('this is a '
>   'long string'),
>  ('this is another '
>   'long string')]

-1, IMHO this makes it more verbose and thus harder to read, because it
takes a while to figure out that the parentheses are not meant to surround
tuples in this case, which would be the one obvious reason to spot them
inside of a list.

In a way, it's the reverse of the "spot the missing comma" problem, more
like a "spot that there's really no comma". That's just as bad, if you ask me.

Stefan





More information about the Python-ideas mailing list