pylint-errors

E1127 (invalid-slice-index)

:x: Problematic code:

data = [1, 2, 3, 4]
print(data[:object])

:heavy_check_mark: Correct code:

data = [1, 2, 3, 4]
print(data[:2])

Rationale:

Used when a slice index is not an integer, None, or an object with an __index__ method.