Message410988
This seems to happen in 3.11 in the REPL only.
>>> def f():
... print(0)
... return yield 42
File "<stdin>", line 3
def f():
^
SyntaxError: invalid syntax
Note that running it from a file gives the expected output:
PS C:\Users\gvanrossum\cpython> py -3.10 .\t.py
File "C:\Users\gvanrossum\cpython\t.py", line 3
return yield 42
^^^^^
SyntaxError: invalid syntax
as does the 3.10 REPL:
>>> def f():
... print(0)
... return yield 42
File "<stdin>", line 3
return yield 42
^^^^^
SyntaxError: invalid syntax |
|
| Date |
User |
Action |
Args |
| 2022-01-19 23:07:56 | gvanrossum | set | recipients:
+ gvanrossum, lys.nikolaou, pablogsal |
| 2022-01-19 23:07:56 | gvanrossum | set | messageid: <[email protected]> |
| 2022-01-19 23:07:56 | gvanrossum | link | issue46441 messages |
| 2022-01-19 23:07:56 | gvanrossum | create | |
|