Why does Python raise TypeError rather than SyntaxError? July 30, 2023 by Tarik Using the colon in an indexing operation generates a slice object, which is not hashable.