When I paste several lines at once in a Python3.9 session in the terminal in my Mac it does not understand that they are different lines, and it fails:
Python 3.9.1 (default, Jan 8 2021, 17:17:17)
[Clang 12.0.0 (clang-1200.0.32.28)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> a = 7
b = 3
a + b
File "<stdin>", line 1
a = 7
b = 3
a + b
^
SyntaxError: multiple statements found while compiling a single statement
But the funny thing is that if I do it in a Python2.7 it goes well:
Python 2.7.16 (default, Jun 5 2020, 22:59:21)
[GCC 4.2.1 Compatible Apple LLVM 11.0.3 (clang-1103.0.29.20) (-macos10.15-objc- on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> a = 7
>>> b = 3
>>> a + b
10
I would think that there is something in my environment or bash_profile but why it fails only in the 3.9 version?
Thanks in advance. Miguel.