invalid-sequence-index / E1126#
Sequence index is not an int, slice, or instance with __index__
Used when a sequence type is indexed with an invalid type. Valid types are ints, slices, and objects with an __index__ method.
fruits = ['apple', 'banana', 'orange'] print(fruits['apple']) # [invalid-sequence-index]
fruits = ['apple', 'banana', 'orange'] print(fruits)
Be careful with
[False] as sequence index, since
False will respectively
be evaluated as
0 and will bring the second element of the list and the first without erroring.
Created by the typecheck checker.