replacing `else` with `then` in `for` and `try`
Ian Kelly
ian.g.kelly at gmail.com
Fri Nov 3 17:57:05 EDT 2017
On Fri, Nov 3, 2017 at 3:25 PM, Stefan Ram <ram at zedat.fu-berlin.de> wrote:
> Jon Ribbens <jon+usenet at unequivocal.eu> writes:
>>No, it's an obvious bug. You have a 'for...else' with no 'break'.
>>Like I said, that should probably be a syntax error.
>
> It should make the syntax of Python much more complicated,
> when one would try to encode this rule in the /syntax/.
>
> (Just try to write down the EBNF.)
>
> It would be more reasonable to call it a constraint.
> Maybe it could still be a parser error (not a runtime
> error).
Regardless of whether it's encoded in the EBNF or a constraint on the
resulting parse tree, the eventual outcome would still be called a
syntax error.
More information about the Python-list
mailing list