On Mon, Sep 28, 2020 at 6:34 AM Samuel Freilich via Python-ideas < firstname.lastname@example.org> wrote:
The message does not include:
- The word "hashable" verbatim, which appears in the glossary
That's a pretty good entry that does talk about the importance of hashability in dicts and sets. So making it easier to find might be enough to help here.
So +1 on adding that link to the error message (if, in fact, links in error messages are on the table at all -- do any existing built in error message have links in them?
and/or at least add "unhashable" to the glossary -- after all, both "mutable" and "immutable" are in there.
- A suggestion of what to do instead
For example: TypeError: dict keys must be hashable ( https://docs.python.org/glossary.html#term-hashable), 'list' is not. Consider using a primitive type (e.g. int, str) or immutable sequence (e.g. tuple, frozenset).
(That could be too much stuff, my point is I think there's room for improvement over "unhashable type: 'list'".)
I filed a bug about this (https://bugs.python.org/issue41114), but it was closed by a core contributor, who suggested discussing that on this list instead. While it's true that you can Google the error message and find the relevant information, I think the error message text would be worth improving.
Peace, -Sam _______________________________________________ Python-ideas mailing list -- email@example.com To unsubscribe send an email to firstname.lastname@example.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://email@example.com/message/B6OMGY... Code of Conduct: http://python.org/psf/codeofconduct/