mirror of
https://github.com/astral-sh/ruff
synced 2026-01-08 23:24:31 -05:00
[syntax-errors] Star expression in index before Python 3.11 (#16544)
Summary -- This PR detects tuple unpacking expressions in index/subscript expressions before Python 3.11. Test Plan -- New inline tests
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
# parse_options: {"target-version": "3.10"}
|
||||
lst[*index] # simple index
|
||||
class Array(Generic[DType, *Shape]): ... # motivating example from the PEP
|
||||
lst[a, *b, c] # different positions
|
||||
lst[a, b, *c] # different positions
|
||||
lst[*a, *b] # multiple unpacks
|
||||
array[3:5, *idxs] # mixed with slices
|
||||
@@ -0,0 +1 @@
|
||||
array[*start:*end]
|
||||
Reference in New Issue
Block a user