On 11/06/2020 16:45, Steven D'Aprano wrote:
On Wed, Jun 10, 2020 at 08:00:26PM -0400, Jonathan Crall wrote:
I wouldn't mind if this *only *worked for the specific characters "print".
I would. What's so special about print? It's just a function.

I use `iter` much more than print. Should we make a special exception
for only 'iter' too? Or instead?

`print` is especially problematic, because zero-argument form of print
is possible. This makes it a landmine waiting for the unwary:

     print x, y, z  # works
     print x  # works
     # now print a blank line
     print  # silent failure


That's especially going to burn people who remember Python 2, where it
did print a blank line instead of evaluating to the `print` object.

No problem!  If the new super-duper all-singing-and-dancing-and-make-the-tea parser can cope with 'print' without parens, it can cope with print followed by nothing. Good addition to the proposal, actually. :-)
(Repeated for clarity: I'm in favour of the proposition for 'print' only.)
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/LRGW2REB6TIOA36N4OJQS67O7XRQAKGW/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to