[Python-ideas] with statement syntax forces ugly line breaks?

MRAB python at mrabarnett.plus.com
Thu Sep 9 00:17:11 CEST 2010


On 08/09/2010 22:30, Nick Coghlan wrote:
> On Thu, Sep 9, 2010 at 4:07 AM, Georg Brandl<g.brandl at gmx.net>  wrote:
>> In addition to the backslash hint already given, I'd like to explain why
>> this version isn't allowed: the parser couldn't distinguish between a
>> multi-context with and an expression in parentheses.
>>
>> (In the case of import, where parens can be used around the import list,
>> this is different, no arbitrary expression is allowed.)
>
> I've sometimes wondered if we should consider the idea of making line
> continuation implicit between keywords and their associated colons.
> I've never seriously investigated the implications for the parser,
> though.
>
If a colon was omitted by mistake, how much later would the parser
report a syntax error?



More information about the Python-ideas mailing list