[Python-ideas] Implicit String Concatenation

Eoghan Murray eoghan at qatano.com
Thu Apr 12 13:34:18 CEST 2007

On 11/04/07, Adam Atlas <adam at atlas.st> wrote:
> On 11 Apr 2007, at 11.01, Collin Winter wrote:
> > On 4/11/07, Georg Brandl <g.brandl at gmx.net> wrote:
> >> No, please! The concatenation of string literals is done in the
> >> parser.
> >> Your proposal would move that to runtime and introduce a
> >> "whitespace operator".
> >> How would you spell that? How would you overload it? etc.
> >
> > A single-width whitespace operator would just be confusing since PEP
> > 3117 will be using zero-width spaces for the None typedef : )
> I propose we use the ASCII character 0x07 (BEL) as the concatenation
> operator. It's invisible, so your code still looks nice and clean,
> but you know it's there because your text editor will beep at you
> every time you pass it. :)

LOL, I'll reply to the funniest put down!

The rationale for this is that Python should have one definitive way
of concatenating strings.
I dislike '+' as a string concatenation operator as I think
overloading the meaning of '+' for non-numbers is ugly, and I dislike
'%s' string formatting as it perpetuates perhaps obscure C syntax, as
well as shunting the variables to the end of the line - hard for a
human to parse.

Given that __juxta__ isn't going to fly, +1 for complete removal of
implicit string concatenation in Py3k


More information about the Python-ideas mailing list