The following run should not indicate any errors
>> ruff check --isolated --preview --select RUF031 --target-version py38 subscript-tuple.py
subscript-tuple.py:1:3: RUF031 [*] Avoid parentheses for tuples in subscripts.
|
1 | d[(*indices, 5)]
| ^^^^^^^^^^^^^ RUF031
|
= help: Remove the parentheses.
Found 1 error.
[*] 1 fixable with the `--fix` option.
As far as I know, d[*indices, 5] is invalid syntax on Python 3.8, but should work for Python >=3.9 (with the new PEG parser, I think? definitely works on 3.12).
Expected result:
- No errors / fixes reported when setting
--target-version py38.
- The recommended fix when setting
--target-version py39 and above.
xref: CI failure resulting from the fix: https://github.com/inducer/pymbolic/actions/runs/10315281929/job/28555159989?pr=144
The following run should not indicate any errors
As far as I know,
d[*indices, 5]is invalid syntax on Python 3.8, but should work for Python >=3.9 (with the new PEG parser, I think? definitely works on 3.12).Expected result:
--target-version py38.--target-version py39and above.xref: CI failure resulting from the fix: https://github.com/inducer/pymbolic/actions/runs/10315281929/job/28555159989?pr=144