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

Joao S. O. Bueno jsbueno at python.org.br
Mon May 20 15:20:53 CEST 2013


On 19 May 2013 15:58, Mark Janssen <dreamingforward at gmail.com> wrote:
>> We can't just "remove implicit concatenation", because that will break code
>> which is currently working perfectly. And probably it will break more
>> working code than it will fix unnoticed broken code.
>
> Really?  Isn't the number of programs breaking roughly equal to 2, perhaps less?

Actually, I find this wording somewhat offensive. I have to make use
of this feature to
code-in long log strings quite often,: as in human readable long
strings that can't have
an arbitrary amount of whitespace inside (not the case for embedded
SQL/HTML snippets), and yet have to be indented along with the code.

That is why my only other e-mail on this thread is about adding some
syntax for auto-
dedenting multiline strings.

Don take me wrong, I dislike auto-concatenation just as the next guy -
typing a new set of \" \" on each line sometimes makes me wonder if
I shoul stop and code a plug-in for that on my editor -
but currently it is the only way of making "pretty enterprise code" with
long strings - but for even more verbose calls to "dedent" or
explicit concatenation ? (which would not save typing the \" \" as well,
just would add even more typing)

But if you have an ok way of adding a long human-readable string
into code with less typing and correct indentation, with the existing
syntax, I'd like to know how do you do it. That would be better than saying
"only 2 programs use this".

   js
 -><-


>
> MarkJ
> Tacoma, Washington
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> http://mail.python.org/mailman/listinfo/python-ideas


More information about the Python-ideas mailing list