On Fri, 23 Apr 2010 23:51:39 -0700, Chris Rebert wrote:

> If the conversion to Decimal in  _convert_other() fails, the operator
> method returns NotImplemented to signal to the interpreter that Decimal
> doesn't know how to do the requested operation with an operand of the
> given type; the interpreter will fall back by calling the reflected
> method of the other operand. 

I knew that works with comparisons __eq__ etc, but somehow I had a mental 
blank about arithmetic operators! Yes, you're right, and the docs say so 
explicitly. Somehow I had convinced myself that NotImplemented only 
worked with comparisons.


-- 
Steven
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to