Raymond Hettinger <raymond.hettin...@gmail.com> added the comment:

> It would be clearer if the message was something like:
> 
> TypeError: 'dict' can not be used as a set value because 
> it is an unhashable type.

IMO that doesn't help.  The trackback already shows the code where the 
exception occurred.  The user already knows the calling type, and the existing 
message tells them what type was passed in.  

Their real problem is that they still have to confront the notion of what 
"unhashable type" means and then need figure-out a way to fix it.  So the 
proposed extra information is just a distractor that doesn't get the user any 
closer to understanding or solving their problem.  

To get a user closer to the solution they would either need an explanation of 
what hashable means and/or be given a suggestion of how to fix it:

   TypeError: unhashable type: 'dict'.  Consider using an int,
   str, tuple, or frozenset.

That said, it is precarious to guess what the user intended, so it is difficult 
to suggest some form of "did you mean ..."

----------
nosy: +rhettinger

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue41114>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to