pylint-errors

E1126 (invalid-sequence-index)

:x: Problematic code:

data = [1, 2, 3]
print(data[object])
# but be careful with data[True], it will work since True is represnted as 1
# and False as 0, so it will work

:heavy_check_mark: Correct code:

data = [1, 2, 3]
print(data[0])

Rationale:

Used when a sequence type is indexed with an invalid type. Valid types are ints, slices, and objects with an __index__ method.