[Python-ideas] Allow parentheses to be used with "with" block

Greg Ewing greg.ewing at canterbury.ac.nz
Mon Feb 16 22:30:59 CET 2015


How about adopting a version of the dangling-operator
rule suggested earlier, but *only* for commas?

I think it could be handled entirely in the lexer: if
you sees a comma followed by a newline, and the next
line is indented further than the current indentation
level, absorb the newline and indentation.

This would take care of all the statements I can think
of that can't currently be parenthesised.

-- 
Greg



More information about the Python-ideas mailing list