This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rhettinger
Recipients ajaksu2, benjamin.peterson, dmalcolm, oliver_gramberg, rhettinger, sean_gillespie
Date 2010-08-11.19:51:40
SpamBayes Score 2.3216457e-05
Marked as misclassified No
Message-id <1281556304.07.0.132946034432.issue1634034@psf.upfronthosting.co.za>
In-reply-to
Content
+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.
History
Date User Action Args
2010-08-11 19:51:44rhettingersetrecipients: + rhettinger, sean_gillespie, ajaksu2, oliver_gramberg, benjamin.peterson, dmalcolm
2010-08-11 19:51:44rhettingersetmessageid: <1281556304.07.0.132946034432.issue1634034@psf.upfronthosting.co.za>
2010-08-11 19:51:41rhettingerlinkissue1634034 messages
2010-08-11 19:51:40rhettingercreate