Decimal, __radd__, and custom numeric types...

Nick Coghlan ncoghlan at iinet.net.au
Tue Mar 1 06:16:37 EST 2005


Blake T. Garretson wrote:
>  If Decimal objects prematurely throw a TypeError before trying the
> __rop__, is Decimal broken, or was it designed this way?

I suspect the former, since I can't recall this subject coming up at any point 
during the PEP approval or implementation process. And I was one of the people 
who worked on it before 2.4 was released :)

So I'd suggest:

a) Checking that replacing the relevant "raise TypeError" calls in 
Lib/Decimal.py with "return NotImplemented" gives you friendlier behaviour.

b) Filing a bug report on SF

I'll be bringing the question up on py-dev as well.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at email.com   |   Brisbane, Australia
---------------------------------------------------------------
             http://boredomandlaziness.skystorm.net



More information about the Python-list mailing list