[Python-ideas] Implicit string literal concatenation considered harmful (options)

Ethan Furman ethan at stoneleaf.us
Wed May 22 00:39:33 CEST 2013


On 05/20/2013 10:12 AM, Mark Janssen wrote:
>>> Really?  Isn't the number of programs breaking roughly equal to 2, perhaps
>>> less?
>>
>> Interesting, how did you get that number?
>
> I was making a joke using "unreasonable precision", but I would like
> to actually see more than that (meaning: I don't think there is) in
> the standard library.  There just isn't much, if at all, of a
> programmatic reason to use such a construct.  It's 1) more typing, 2)
> a highly improbably sequence that accidently worked by the programmer,
> 3) it doesn't really satisfy any conceptual separation that I can
> envision (putting two string literals on the same line?  what possible
> purpose?)
>
> And this is the point -- it's more likely a programmer error.  Really,
> I have a hard time believing that the number of programs that would
> break being larger than a handful.   And to fix it is a no-brainer.

On the same line is probably rare, I agree.

On different lines it is very common.  Much more common than the number of errors generated by the forgotten comma.

--
~Ethan~


More information about the Python-ideas mailing list