mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-26 11:59:10 +00:00
Improve slice formatting (#5922)
<!-- Thank you for contributing to Ruff! To help us out with reviewing, please consider the following: - Does this pull request include a summary of the change? (See below.) - Does this pull request include a descriptive title? - Does this pull request include references to any relevant issues? --> ## Summary - Remove space when start of slice is empty - Treat unary op except `not` as simple expression ## Test Plan Add some simple tests for unary op expressions in slice Closes #5673
This commit is contained in:
parent
d351761f5d
commit
b866cbb33d
7 changed files with 33 additions and 212 deletions
|
@ -70,12 +70,15 @@ def a():
|
|||
e00 = "e"[:]
|
||||
e01 = "e"[:1]
|
||||
e02 = "e"[: a()]
|
||||
e03 = "e"[:-1]
|
||||
e10 = "e"[1:]
|
||||
e11 = "e"[1:1]
|
||||
e12 = "e"[1 : a()]
|
||||
e13 = "e"[1:-1]
|
||||
e20 = "e"[a() :]
|
||||
e21 = "e"[a() : 1]
|
||||
e22 = "e"[a() : a()]
|
||||
e23 = "e"[a() : -1]
|
||||
e200 = "e"[a() :: ]
|
||||
e201 = "e"[a() :: 1]
|
||||
e202 = "e"[a() :: a()]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue