[issue40246] Different error messages for same error - invalid string prefixes

Lysandros Nikolaou report at bugs.python.org
Wed Apr 29 12:27:01 EDT 2020


Lysandros Nikolaou <lisandrosnik at gmail.com> added the comment:

What's also possible is to handle keywords at tokenizer level and return a different token type for each one of them (like with async and await), which is currently handled at parser level. This would enable us to allow reserved keywords right before a STRING token, thus covering all the possible broken code cases, but continue disallowing arbitrary NAMEs, which would mean better error-reporting in the case of invalid prefixes.

----------

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


More information about the Python-bugs-list mailing list