[Python-ideas] Descouraging the implicit string concatenation

Søren Pilgård fiskomaten at gmail.com
Wed Mar 14 09:57:37 EDT 2018


On Wed, Mar 14, 2018 at 2:54 PM, Paul Moore <p.f.moore at gmail.com> wrote:
> On 14 March 2018 at 13:40, Søren Pilgård <fiskomaten at gmail.com> wrote:
>> We can't remove all potential pitfalls, but I do think there is value
>> in evaluating whether something has bigger potential to cause harm
>> than the benefits it brings, especially if there are other ways to do
>> the same.
>
> Certainly. However, in this case opinions differ (I, like Steven, have
> no problem with implicit string concatenation, and in certain cases
> prefer it over using explicit addition and relying on the compiler
> optimising that away for me).
>
> Also, we need to consider the significant body of code that would
> break if this construct were prohibited. Even if we were to agree that
> the harm caused by implicit concatenation outweighed the benefits,
> that would *still* not justify making it illegal, unless the net gain
> could be shown to justify the cost of forcing every project that
> currently uses implicit concatenation to change their code, debug
> those changes, make new releases, etc.
>

I guess that is why the proposal is to discourage the use, not removing it.


More information about the Python-ideas mailing list