Why is it possible to use boolean values as index in python? e.g
>>> a = [1, 2, 3, 4, 5]
>>> a[True]
2
>>> a[False]
1
Since python is a strongly typed language, shouldn't the compiler throw a TypeError just like when adding a string and integer together? e.g.
>>> "1" + 1
Traceback (most recent call last):
File "<input>", line 1, in <module>
TypeError: cant convert 'int' object to 'str' implicitly
>>> 1 + "1"
Traceback (most recent call last):
File "<input>", line 1, in <module>
TypeError: unsupported operand type(s) for +: 'int' and 'str'