Why does foo[‘bar’: ‘baz’] raise TypeError rather than SyntaxError?

Using the colon in an indexing operation generates a slice object, which is not hashable.

Leave a Comment