bpo-34013: Move the Python 2 hints from the exception constructor to the parser by pablogsal · Pull Request #27392 · python/cpython (original) (raw)

>>> print a+b, c+d, f()
  File "<stdin>", line 1
    print a+b, c+d, f()
    ^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?

>>> 3,4 , [print 3+4, 6+7, 8], 34
  File "<stdin>", line 1
    3,4 , [print 3+4, 6+7, 8], 34
           ^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?

>>> print {3+4, 6+7, 8}, 45, 6
  File "<stdin>", line 1
    print {3+4, 6+7, 8}, 45, 6
    ^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?

>>> (print {3+4, 6+7, 8}, 45, 6), 5
  File "<stdin>", line 1
    (print {3+4, 6+7, 8}, 45, 6), 5
     ^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?