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

Guido van Rossum report at bugs.python.org
Fri Jun 6 18:46:23 CEST 2014


Guido van Rossum added the comment:

I also found some amusing false positives (syntax errors that weren't valid print statements in Python 2):

    print [/
    print /
    print )    # but not "print)" !
    print]

None of these matter though.  Perhaps more concerning is how many things are valid syntax, despite making little sense:

    print [42]
    print

Still I like the idea -- even if it only catches 50% of all print statements that would still be a huge win. (And I think it's probably closer to 80%.)

----------

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


More information about the Python-bugs-list mailing list