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

Ron Adam ron3200 at gmail.com
Sun May 19 00:20:55 CEST 2013



On 05/18/2013 03:58 PM, Steven D'Aprano wrote:
> On 19/05/13 04:16, Ron Adam wrote:
>
>> If implicit string concatenation is removed, it would be nice if there
>> was an explicit replacement for it.  There is a strong consensus for
>> doing it,
>
> I don't think there is. From what I have seen, there have been nearly as
> many people objecting to the proposed removal as there have been people
> supporting it, ...

Correct, there isn't a very strong consensus for the removal.  But the 
discussion has been focused more on a replacement than on a eventual future 
removal down the road.

If it was to be removed (as I said), there is a strong consensus for some 
sort of an explicit variation to replace it.  But there isn't any agreement 
on how to do that.

The discussion is split between not removing it and removing it with some 
sort of replacement.  We need to know how many people are ok with removing 
it even if a replacement is not found.  (It doesn't mean one won't be found.)


it is only that some of the people supporting the removal
> are more vocal, proposing alternative after alternative, none of which are
> particularly nice. Single dot, ellipsis, yet another string prefix c'',
> forced backslashes, ampersand... Have I missed any?


>> but there isn't strong consensus on how to do it.
>
>> About line continuations:
>>
>> Line continuations are a related issue to string concatenations because
>> they are used together fairly often.
>
> They might be related, but they are orthogonal. We could change one, or the
> other, or both, or neither. There are virtues to changing the behaviour of
> \ line concatenation independent of any changes made to strings.

I agree.



>> The line continuation behaviour is a bit quarky,
>
> Do you mean "quirky"? Quarky would mean "like quark(s)", which could refer
> to something being like a type of German cream cheese, or possibly like
> fundamental subatomic particles that make up protons and neutrons.

LOL.. Yes quirky.  Definitely not the cheese.   ;-)


>> There are a number of options that have been discussed but those haven't
>> really been clearly spelled out so the discussion has been kind of out of
>> focus. This seems like an overly detailed list, but the discussion has
>> touched on pretty much all of these things.  I think the goal should be
>> to find the most cohesive combination for Python 4 and/or just go with B
>> alone.
>>
>>
>> A.  Do nothing.
>>
>> B.  Remove implicit concatenation.
>>
>>    (We could stop here, anything after this can be done later.)
>
>
> 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.
>
> So removal requires a deprecation schedule: deprecate for at least one
> release. The conservative approach is:
>
> * mark as deprecated in the docs in 3.4;
>
> * raise a deprecated warning in 3.5;
>
> * remove in 3.6.

Correct, and is why I believe we should start the process... with the 
intention of doing it in python 4 or possibly earlier if there is support 
for doing it sooner.  (I had put that in, but it got edited out.)

Any way, this is my vote.


> or even later. Any removal of functionality leads to code churn: people
> will be forced to change code that works now because it will stop working
> in the future. That's a serious cost even when there are clear and obvious
> benefits to the removal.

I agree with this also.  I think starting the process now and depreciating 
it sooner rather than later would help reduce the code churn down the road.

It will also help focus any future discussions of the additional features 
in the light of implicit concatenation being removed.

Cheers,
    Ron



More information about the Python-ideas mailing list