davidhalter / davidhalter/parso
yield inside of list comprehension
- Dominant language
- Python
- Stars
- 679
- Forks
- 120
- PR merge metrics
- No merged PRs in 30d
Description
for <=py3.7
```
$ python3.7
Python 3.7.5 (default, Apr 19 2020, 20:18:17)
[GCC 9.2.1 20191008] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> (lambda: [(yield x + 1) for x in seq])
at 0x7f185ed11440>
>>> get_errors("(lambda: [(yield x + 1) for x in seq])")
[]
>>> get_errors("(lambda: [(yield x + 1) for x in seq])")[0].message
"SyntaxError: 'yield' outside function"
>>>
```
py3.8>=
```
$ python3
Python 3.10.0a0 (heads/master:7b78e7f9fd, May 30 2020, 13:18:34)
[GCC 9.2.1 20191008] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> (lambda: [(yield x + 1) for x in seq])
File "", line 1
SyntaxError: 'yield' inside list comprehension
>>> get_errors("(lambda: [(yield x + 1) for x in seq])")[0].message
"SyntaxError: 'yield' outside function"
```
Contributor guide
Assessment
This issue has not been assessed yet.