[Python-ideas] Extending expressions using ellipsis

Steven D'Aprano steve at pearwood.info
Thu Sep 1 12:26:02 EDT 2016


On Thu, Sep 01, 2016 at 10:04:12AM -0500, Ryan Hiebert wrote:
> 
> > On Sep 1, 2016, at 1:40 AM, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
> > 
> > Guido van Rossum wrote:
> >> Would this be enforced in the grammar or by the lexer? Since you say
> >> you expect the indentation to be enforced, that suggests it would be
> >> done by the grammar,
> > 
> > I think it could be done by having the lexer enter a mode
> > where it swallows a newline that is followed by an indentation
> > to a level greater than the starting level of the construct.
> > Then no change would be needed to the grammar.
> 
> +1
> 
> This is what I would like. It wouldn't require the ellipsis marker, 
> AFAICT, and would eliminate so many parenthesis and backslashes from 
> my code.

-1 on implicit line continuations.

Having explicit parens (or even the much-maligned backslash line 
continuation) is a good thing, making it clear that, yes, the extra 
indentation is intentional.


-- 
Steve


More information about the Python-ideas mailing list