Raymond Hettinger <rhettin...@users.sourceforge.net> added the comment:

+1 on the basic idea to make error messages more informative where possible, 
but am not sure how it would work in any but the more simple cases.  

How would work in cases where there are multiple possible "expected" tokens?

   >>> def f(x 3):      
   SyntaxError: invalid syntax

It chokes at the "3".  The expected token is either a comma, colon, or closing 
parenthesis.

Also, the most annoying and least obvious syntax errors are ones that are 
revealed many characters away from the original cause (i.e. unbalanced opening 
brackets or parentheses).  Am not sure how you can readily construct a helpful 
message in these cases.

----------
nosy: +rhettinger

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue1634034>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to