This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author sfreilich
Recipients iritkatriel, rhettinger, sfreilich
Date 2020-09-27.23:11:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1601248309.9.0.580002983905.issue41114@roundup.psfhosted.org>
In-reply-to
Content
> The user already knows

The example I link to in the initial description appears to be one case where the user does not in fact know.

I do think context that this restriction applies to dict key in particular is very relevant. The line could use the same type for both the key and the value in a dict assignment, for example.

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

That seems like a pretty reasonable wording, though I think mentioning "dictionary key" or "set item" specifically still helps.

It could also link to the documentation directly:
https://docs.python.org/3/glossary.html#term-hashable

Though other error messages don't generally follow that pattern.

> Saying it twice doesn't help.

As the comment you were responding to noted, putting it in the type implies there might be additional information in documentation (or at least provides a place in documentation to put that information). TypeError is too general to say something about that specifically:
https://docs.python.org/3/library/exceptions.html#TypeError
History
Date User Action Args
2020-09-27 23:11:49sfreilichsetrecipients: + sfreilich, rhettinger, iritkatriel
2020-09-27 23:11:49sfreilichsetmessageid: <1601248309.9.0.580002983905.issue41114@roundup.psfhosted.org>
2020-09-27 23:11:49sfreilichlinkissue41114 messages
2020-09-27 23:11:49sfreilichcreate