[DB-SIG] Looking for objections to adding decimal numbers to Python

Michael McLay mmclay@comcast.net
Thu, 09 Jan 2003 00:21:10 -0500


On Friday 20 December 2002 07:58 am, Michael McLay wrote:
> There has been a discusion of adding a "decimal" number type to core
> distribution on the python-dev mailing list over the past couple weeks.
> This new type would likely be used most often for financial data that is
> stored in SQL databases. Tim Peters describes two different types of
> decimal numbers in the forwarded message that is attached to this message.
> I do not have the insight into the typical SQL database use of decimal
> numbers. Are they the fixed point type numbers that Tim has implemented in
> FixedType (with "banker" rounding properties), or are they  the Cowlishhaw
> float numbers as described by Tim? My objective in pushing for adding a
> decimal type is to have useful decimal numbers that for manipulating data
> from SQL databases added to Python, I'd like to make sure those numbers
> have the right semantics for that goal.
>
> Comments?

Should FixedPoint [1] be added to the standard distribution? If now, why not?

The deafening silence suggests either a lack of interest, or poor timing by 
asking  the question just before a holiday. I hope it was the latter. I think 
Python deserves a number type that is usable by the financial community. 
Guido has put off any syntax changes, but at the vary least Python 2.3 should 
consider adding a "batteries included" module that provides a decimal number 
capability. 

It is hard to believe that something that is so fundamental to financial data 
manipulation can attract less interest than the the addition of the reST 
module to the standard distribution. Please look at 
http://fixedpoint.sourceforge.net/ and weigh in on the correctness of this 
module for use in financial calculations. It is hard to believe that you 
object to the algorithms used in the implementation of this module (it was 
written by Tim Peters.) So if you object, please provide some clue as to why 
FixedPoint doesn't meet your requirements. 

[1] http://fixedpoint.sourceforge.net/