[issue34013] Inconsistent SyntaxError for print

Dong-hee Na report at bugs.python.org
Sat Jun 30 13:42:58 EDT 2018


New submission from Dong-hee Na <donghee.na92 at gmail.com>:

Python 3.8.0a0 (heads/master-dirty:0cdf5f4289, Jul  1 2018, 02:30:31)
[Clang 9.1.0 (clang-902.0.39.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> print "hi"
  File "<stdin>", line 1
    print "hi"
             ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("hi")?
>>> def add(a,b):
...     return a + b
...
>>> print add(3,5)
  File "<stdin>", line 1
    print add(3,5)
            ^
SyntaxError: invalid syntax

IMHO, an error message should be 'SyntaxError: Missing parentheses in call to 'print'. Did you mean print(add(3,5))?' but it is not.

----------
messages: 320797
nosy: corona10
priority: normal
severity: normal
status: open
title: Inconsistent SyntaxError for print
versions: Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34013>
_______________________________________


More information about the Python-bugs-list mailing list