Chris Angelico <ros...@gmail.com>: > On Thu, Nov 26, 2015 at 9:54 PM, Marko Rauhamaa <ma...@pacujo.net> wrote: >> >> >>> hash([]) >> Traceback (most recent call last): >> File "<stdin>", line 1, in <module> >> TypeError: unhashable type: 'list' >> >> Annoying. > > Yes, it's really annoying that you get an immediate exception instead > of unpredictably getting bizarre failures that depend on the exact > bucket sizes and dict size and so on. It's such a pain to get told > exactly where the problem is.
The problem is that lists don't have __hash__ and __eq__ defined. > Python tends to assume that programmers are intelligent people who are > prepared to fix their mistakes. It's not letting me in the case of list. Marko -- https://mail.python.org/mailman/listinfo/python-list