Stefan Krah <stefan-use...@bytereef.org> added the comment: Raymond Hettinger <rep...@bugs.python.org> wrote: > The choice between ValueError and TypeError can sometimes be ambiguous and > seem arbitrary and I understand why you're gravitating towards ValueError > (because it works some values and not others), but in this case the API is > already fixed by what hash() does elsewhere. > > It is no fair to users to have to wrap hash(x) calls with a try/except that > catches both exceptions. So, we should still to a consistent hash API: > > >>> hash([]) > Traceback (most recent call last): > File "<pyshell#1>", line 1, in <module> > hash([]) > TypeError: unhashable type: 'list' > > In this case, practicality beats purity and released beats unreleased.
Ok, this makes sense. I can revert the commit unless you prefer to handle it yourself. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue10356> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com