mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-04 10:48:32 +00:00
[syntax-errors] Tuple unpacking in return
and yield
before Python 3.8 (#16485)
Summary -- Checks for tuple unpacking in `return` and `yield` statements before Python 3.8, as described [here]. Test Plan -- Inline tests. [here]: https://github.com/python/cpython/issues/76298
This commit is contained in:
parent
0a627ef216
commit
6c14225c66
15 changed files with 1217 additions and 8 deletions
|
@ -0,0 +1,3 @@
|
|||
# parse_options: {"target-version": "3.7"}
|
||||
rest = (4, 5, 6)
|
||||
def f(): return 1, 2, 3, *rest
|
|
@ -0,0 +1,4 @@
|
|||
# parse_options: {"target-version": "3.7"}
|
||||
rest = (4, 5, 6)
|
||||
def g(): yield 1, 2, 3, *rest
|
||||
def h(): yield 1, (yield 2, *rest), 3
|
|
@ -0,0 +1,3 @@
|
|||
# parse_options: {"target-version": "3.7"}
|
||||
rest = (4, 5, 6)
|
||||
def f(): return (1, 2, 3, *rest)
|
|
@ -0,0 +1,3 @@
|
|||
# parse_options: {"target-version": "3.8"}
|
||||
rest = (4, 5, 6)
|
||||
def f(): return 1, 2, 3, *rest
|
|
@ -0,0 +1,3 @@
|
|||
# parse_options: {"target-version": "3.7"}
|
||||
rest = (4, 5, 6)
|
||||
def g(): yield (1, 2, 3, *rest)
|
|
@ -0,0 +1,4 @@
|
|||
# parse_options: {"target-version": "3.8"}
|
||||
rest = (4, 5, 6)
|
||||
def g(): yield 1, 2, 3, *rest
|
||||
def h(): yield 1, (yield 2, *rest), 3
|
Loading…
Add table
Add a link
Reference in a new issue