[Python-3000] Line continuation using ellipsis

Talin talin at acm.org
Wed Apr 11 17:01:45 CEST 2007

I'm not sure that I am the first to bring this up, but I might as well 
get it written down.

I've never liked using the backslash operator for line continuation, for 
two reasons:

1) It requires that it be the last character of a line, meaning that you 
have to insure that there's no trailing whitespace, which can be 
difficult with some editors.

2) As a wise sage once said, "it looks like line noise on my monitor".

I'm not proposing to remove the feature, however I'd like to see an 
alternative method for declaring statements that cross a line boundary. 
I seem to recall at one point someone suggesting the use of ellipsis, 
which makes a lot of sense to me:

    sorted_result = partition_lower( input_list, pivot ) ...
       + pivot ...
       + partition_upper( input_list, pivot )

Parsing-wise, an ellipsis operator would have the following meaning: 
Inside a parenthesized or bracketed expression, it would have the same 
meaning it does now. Otherwise, it has the meaning "consume all 
whitespace, including newlines".

-- Talin

More information about the Python-3000 mailing list