On 2017-09-20 17:06, Dennis Lee Bieber wrote: > On Wed, 20 Sep 2017 10:08:18 +1000, Steve D'Aprano > <steve+pyt...@pearwood.info> declaimed the following: > >> For what its worth: from Python 3.5 (I think) onwards the error you get is >> customized: >> >> py> print 1 >> File "<stdin>", line 1 >> print 1 >> ^ >> SyntaxError: Missing parentheses in call to 'print' >> > > So... "print" (the function") is still a special case for the > interpreter... >
Thankfully just the interpreter, and not you or me. Also, print is not alone in this regard: Python 3.6.0 |Continuum Analytics, Inc.| (default, Dec 23 2016, 12:22:00) [GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> print 1 File "<stdin>", line 1 print 1 ^ SyntaxError: Missing parentheses in call to 'print' >>> exec 'print 1' File "<stdin>", line 1 exec 'print 1' ^ SyntaxError: Missing parentheses in call to 'exec' >>> exec('print 1') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "<string>", line 1 print 1 ^ SyntaxError: Missing parentheses in call to 'print' >>> -- Thomas Jollans -- https://mail.python.org/mailman/listinfo/python-list