prePEP: Money data type

Alex Martelli aleax at aleax.it
Sat Oct 18 06:36:49 EDT 2003


Jegenye 2001 Bt wrote:

> You're right, Alex, in that arithmetic is the real issue to be addressed,
> not formatting..
> 
> I also wonder if computation error should be tracked with this class, i.e.
> when you assign a Money type value of 1.21 then  you know that the error
> is 0.05 at most.
> After that the usual error propagation rules apply for the arithmetic
> operations..

That's not the way accountants do it in most situations.  I think a numeric
class with explicit error bounds and propagations may have its place, but
that place is not as "the" type recommended for money computations in
most Python application programs, IMHO.


Alex





More information about the Python-list mailing list