Why not FP for Money?

Carlos Ribeiro carribeiro at gmail.com
Fri Sep 24 22:48:24 CEST 2004


[Facundo Batista]
# Why those steps? To achieve a community consensus for the PEP 
# I've made was not easy and took me a long time. Before it becomes
# a core data type (if someday), decimal needs to be used *widely*. 
# So start spreading the word! :) 
...
# Meanwhile, use decimal.Decimal("<number>"). 

The problem is that the notation proposed for literals is a show
stopper. I can guarantee to you that any novice using Python would
immediately understand and use the Decimal type -- but only if the
notation were convenient enough. More often than not, people will
continue to use floats, have precision problems, and complain at
c.l.py. I could bet that the number of threads about rounding errors
is not going to be lower over the next months even with Decimal in the
standard library :-) (Let's hope I'm wrong!)



-- 
Carlos Ribeiro
Consultoria em Projetos
blog: http://rascunhosrotos.blogspot.com
blog: http://pythonnotes.blogspot.com
mail: carribeiro at gmail.com
mail: carribeiro at yahoo.com



More information about the Python-list mailing list