19 Jan
2020
19 Jan
'20
7:46 a.m.
On Fri, Jan 17, 2020, at 21:32, Josh Rosenberg wrote:
The colon remains syntactically necessary in some cases, particularly to disambiguate cases involving one-lining (no block involved). Stupid example: If the colon is optional, what does:
I was only proposing making it optional in the multi-line case. The following in the grammar: [anywhere it appears]: ... ':' suite suite: simple_stmt | NEWLINE INDENT stmt+ DEDENT would be replaced with [whatever]: ... compound_body compound_body: ':' simple_stmt | [':'] NEWLINE INDENT stmt+ DEDENT (I don't understand how TYPE_COMMENT interacts with NEWLINE/INDENT/DEDENT well enough to do the same for func_body_suite in terms of the actual grammar)