> The code which raises TypeError does not know whether it was called internally by dict or set method or explicitly by hash
It's true, but I don't think it would be too hard to preserve some of the context in some of those common cases. In that bug report, I suggested adding an optional parameter for the format string used to generate the error message to PyObject_Hash and PyObject_HashNotImplemented (but I haven't yet tried to sketch out a full code change).
That doesn't fully cover the case where hash calls hash recursively, and obviously we wouldn't want to handle that in a way that potentially mucks with the performance of hash functions.
> do any existing built in error message have links in them?
I don't think so, which is maybe a reason to avoid the inconsistency. I don't know whether that's the result of some intentional decision. I do think it can be useful to have more direct links to documentation, though.
> at least add "unhashable" to the glossary -- after all, both "mutable" and "immutable" are in there.
I think that's reasonable.