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 interp
On Fri, Apr 23, 2010 at 11:25 PM, Steven D'Aprano
wrote:
> On Sat, 24 Apr 2010 09:05:14 +0530, Kushal Kumaran wrote:
>> On Sat, Apr 24, 2010 at 8:54 AM, Steven D'Aprano
>> wrote:
>>> I'm reading the source code for decimal.Decimal, and I see that the
>>> arithmetic operations (__add__, __sub__, e
On Sat, 24 Apr 2010 09:05:14 +0530, Kushal Kumaran wrote:
> On Sat, Apr 24, 2010 at 8:54 AM, Steven D'Aprano
> wrote:
>> I'm reading the source code for decimal.Decimal, and I see that the
>> arithmetic operations (__add__, __sub__, etc.) start with code like
>> this:
>>
>> if other is Not
On Sat, Apr 24, 2010 at 8:54 AM, Steven D'Aprano
wrote:
> I'm reading the source code for decimal.Decimal, and I see that the
> arithmetic operations (__add__, __sub__, etc.) start with code like this:
>
> if other is NotImplemented:
> return other
>
>
> I don't understand the pu
I'm reading the source code for decimal.Decimal, and I see that the
arithmetic operations (__add__, __sub__, etc.) start with code like this:
if other is NotImplemented:
return other
I don't understand the purpose of this. I presume that it is *not* for
the use-case of:
d