Author ncoghlan
Recipients CuriousLearner, eric.smith, ncoghlan
Date 2017-06-08.12:57:52
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1496926673.11.0.491005855935.issue30597@psf.upfronthosting.co.za>
In-reply-to
Content
Those are easy enough to check with strncmp() even in C, so we could make them manageable by just including "<expr>" in the error message, rather than the full text of the original statement.

That is:

    Did you mean 'print(<expr>)'?                 # Default 
    Did you mean 'print(<expr>, file=<stream>)'?  # starts with '>>'
    Did you mean 'print(<expr>, end=' ')'?        # ends with ','

That's basically correct even when printing multiple arguments, so I'd avoid the temptation to detect commas within the line (particularly since they might be inside a string).
History
Date User Action Args
2017-06-08 12:57:53ncoghlansetrecipients: + ncoghlan, eric.smith, CuriousLearner
2017-06-08 12:57:53ncoghlansetmessageid: <1496926673.11.0.491005855935.issue30597@psf.upfronthosting.co.za>
2017-06-08 12:57:53ncoghlanlinkissue30597 messages
2017-06-08 12:57:52ncoghlancreate