[docs] [issue29986] Documentation recommends raising TypeError from tp_richcompare

Devin Jeanpierre report at bugs.python.org
Tue Apr 4 20:15:20 EDT 2017


Devin Jeanpierre added the comment:

Yeah, I agree there might be a use-case (can't find one offhand, but in principle), but I think it's rare enough that you're more likely to be led astray from reading this note -- almost always, NotImplemented does what you want.

In a way this is a special case of being able to raise an exception at all, which is mentioned earlier ("if another error occurred it must return NULL and set an exception condition.")

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue29986>
_______________________________________


More information about the docs mailing list