Message377583
> 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 |
|
Date |
User |
Action |
Args |
2020-09-27 23:11:49 | sfreilich | set | recipients:
+ sfreilich, rhettinger, iritkatriel |
2020-09-27 23:11:49 | sfreilich | set | messageid: <1601248309.9.0.580002983905.issue41114@roundup.psfhosted.org> |
2020-09-27 23:11:49 | sfreilich | link | issue41114 messages |
2020-09-27 23:11:49 | sfreilich | create | |
|