mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-04 02:39:12 +00: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:
parent
2cd25ef641
commit
4f2851982d
8 changed files with 933 additions and 0 deletions
|
@ -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]
|
Loading…
Add table
Add a link
Reference in a new issue