Terry J. Reedy <[email protected]> added the comment:
'Consistency' is in the eye of the beholder in that it is relative to some
ideal. 'Inconsistent' has too much baggage as bad'. I would prefer to call
the current rule 'restricted' or 'limited' and judge any expansion on its own
merits.
The arguments to print can take an unbounded amount of space. So a general
message "Did you mean print(<full argument list>)?" could also be indefinitely
long. I don't think this is a good idea. Of course, the same applies to a
single literal, especially multiline string literals. But at least the latter
are currently clipped to only the first line in the message.
>>> print '''first line
second line'''
SyntaxError: Missing parentheses in call to 'print'. Did you mean
print('''first line)?
(The above would be better with trailing ... .) This abbreviation would be
harder with multiple arguments. The special message is for beginners. They
might print a literal or name without ()s more frequently. I not sure that
they need the reminder with every mistake.
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue34013>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com