[issue21669] Custom error messages when print & exec are used as statements

Guido van Rossum report at bugs.python.org
Thu Jun 5 18:15:30 CEST 2014


Guido van Rossum added the comment:

I'm sorry, but I find this way too intrusive, and a little risky too (I'm not sure how to verify even that the new parser accepts exactly the same set of programs as the old version).

I would much prefer a solution to this particular issue along the lines of a heuristic based on detecting whether the line where the syntax error occurs starts with the token 'print' or 'exec' followed by anything except a left parenthesis.

Such a heuristic could also be added to 3.4.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21669>
_______________________________________


More information about the Python-bugs-list mailing list