flake8-simplify icon indicating copy to clipboard operation
flake8-simplify copied to clipboard

[New Rule] Find consecutive slices

Open kasium opened this issue 2 years ago • 0 comments

Explanation

Find consecutive slices which can be replaced by just one slice.

Example

foo = [1,2,3,4]

# Bad
foo[1:][:2]
foo[1:][2:]

# Good
foo[1:3]
foo[3:]

kasium avatar Apr 13 '22 07:04 kasium