Decimal, __radd__, and custom numeric types...

Nick Coghlan ncoghlan at iinet.net.au
Tue Mar 1 07:05:36 EST 2005


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

It turns out this isn't really practical - there's too much code in the module 
relying on those TypeErrors being raised.

So this may change for Python 2.5 (I think it's a genuine bug), but you're 
probably stuck with it for 2.4 (since changing it is a big enough semantic 
change to break code in the same module, so who knows what it would do to user 
code).

Bugger :(

Cheers,
Nick.

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



More information about the Python-list mailing list