[issue34013] Inconsistent SyntaxError for print

Serhiy Storchaka report at bugs.python.org
Wed Feb 17 08:36:51 EST 2021


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

Would it be too much if add a Python 2 rule for print statement in grammar to produce better error message?

invalid_print_stmt:
    | 'print' ( test (',' test)* [','] ] |
                '>>' test [ (',' test)+ [','] ) {
      RAISE_INVALID_PRINT_STATEMENT() }

----------
nosy: +pablogsal

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


More information about the Python-bugs-list mailing list