[docs] [issue32899] Not documented: key in dict test may raise TypeError

xitop report at bugs.python.org
Thu Feb 22 01:56:24 EST 2018


xitop <reg.bugs at poti.sk> added the comment:

While I do fully agree with not documenting all exceptions, I'd like to point out a major difference in the case of "unhashable in dict". 

It differs from the general case where an exception means the function is unable to return a meaningful result, beacuse it easily COULD return False as its documentation states. The exception is raised by a design decision, not by necessity. That makes it special.

A single sentence like "A hashable key is precondition of all dict operations." would explain the behaviour well. 

That's all I wanted to say. Thank you.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue32899>
_______________________________________


More information about the docs mailing list