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

MRAB python at mrabarnett.plus.com
Thu May 16 17:00:00 CEST 2013


On 16/05/2013 15:44, Chris Angelico wrote:
> On Fri, May 17, 2013 at 12:40 AM, MRAB <python at mrabarnett.plus.com> wrote:
>> On 16/05/2013 08:08, Serhiy Storchaka wrote:
>>> As was said before the '+' operator has less priority than the '%'
>>> operator and an attribute access, i.e. it requires parenthesis in some
>>> cases. However parenthesis introduce a noise and can cause other types
>>> of errors.
>>>
>> I wonder whether we could use ".". Or would that be too confusing?
>
> And I apologized for borrowing an idea from bash. Taking an idea from PHP?!?
>
It has high precendence as far as the parser is concerned.

I know that Perl uses it. I haven't looked at PHP (I hear bad things
about it! :-)).

> Seriously, I don't think another operator is needed. If it's not going
> to be the implicit concatenation by abuttal, + or \ will carry the
> matter. But I share the opinion of several here: implicit
> concatenation is not as bad as the alternatives.
>
It wouldn't be an operator as such.


More information about the Python-ideas mailing list