[Python-Dev] The role of NotImplemented: What is it for and when should it be used?

Ethan Furman ethan at stoneleaf.us
Mon Nov 3 20:33:34 CET 2014


Summary:

NotImplemented _should_ be used by the normal and reflected binary methods (__lt__, __add__, __xor__, __rsub__, etc.)

NotImplemented _may_ be used by the in-place binary methods (__iadd__, __ixor__, etc.), but the in-place methods are 
also free to raise an exception.

Correct?

--
~Ethan~


More information about the Python-Dev mailing list