[New-bugs-announce] [issue33766] Grammar Incongruence

Isaac Elliott report at bugs.python.org
Mon Jun 4 00:05:20 EDT 2018


New submission from Isaac Elliott <isaace71295 at gmail.com>:

echo 'print("a");print("b")' > test.py

This program is grammatically incorrect according to the specification (https://docs.python.org/3.8/reference/grammar.html). But Python 3 runs it without issue.


It's this production here

simple_stmt: small_stmt (';' small_stmt)* [';'] NEWLINE

which says 'simple_stmt's must be terminated by a newline. However, the program I wrote doesn't contain any newlines.

I think the grammar spec is missing some information, but I'm not quite sure what. Does anyone have an idea?

----------
components: Interpreter Core
messages: 318617
nosy: Isaac Elliott
priority: normal
severity: normal
status: open
title: Grammar Incongruence
type: behavior
versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33766>
_______________________________________


More information about the New-bugs-announce mailing list