Batista, Facundo wrote:
[Nick Coghlan]

#- >> 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.
#-
#- ...
#-
#- Py> x = friendly_decimal.Decimal()
#- Py> C() + x
#- OK!
#- Py> x + C()
#- OK!

Nick, did you try the test cases with this modification?

Yep - and I was pleasantly surprised when they all passed with -udecimal, too.

My implementation is a bit hackish though - if this gets fixed for real, it should be possible to devise something that doesn't trample all over performance like I'm sure the version I linked to does.

Anyway, I've put the question to python-dev if you'd like to chime in over there. It's still your module after all :)

Regards,
Nick.

--
Nick Coghlan   |   [EMAIL PROTECTED]   |   Brisbane, Australia
---------------------------------------------------------------
            http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to