[Python-3000] PEP-3125 -- remove backslash continuation

Tim Peters tim.peters at gmail.com
Wed May 2 22:30:16 CEST 2007

[Tim Peters]
>> ...
>> OTOH, the "open bracket" rule is certainly sufficient by itself, and
>> is invaluable for writing "big" list, tuple, and dict literals (things
>> I doubt come up in Andrew's EFL inspiration).

[Andrew Koenig]
> If comma is treated as an operator, the "open bracket" rule doesn't seem all
> that invaluable to me.  Can you give me an example?

Treating comma as an infix operator would clash in weird ways with the
current "sometimes" treatment of comma as denoting a tuple literal ...
and I see that Giovanni Bajo already posted an example while I was
typing this :-)  Icon doesn't have this problem, and I'm guessing that
EFL doesn't either.

Incidentally, I know one Python programmer who writes list literals like this:

mylist = [
         , 2
         , 3

In a fixed-width font, the commas and brackets are all in the same
column.  While "bleech" is the proper reaction ;-), that does work
fine today.

Historical note:  the open bracket rule was introduced in Python 0.9.9
(29 Jul 1993).  Before that, backslash continuation was the only way
to split a statement across lines.  If the open bracket rule had been
there from the start, I doubt backslash continuation would have been
there at all (except in string literals).

More information about the Python-3000 mailing list