[Python-Dev] Fixed-point numeric type
Kevin Jacobs
jacobs@penguin.theopalgroup.com
Wed, 5 Feb 2003 07:27:33 -0500 (EST)
On Wed, 5 Feb 2003, M.-A. Lemburg wrote:
> Just as data point:
>
> I started developing mxNumber to experiment with fixed point
> and rational numeric types (supplied by GMP). My original intention
> was to make use of these in mxODBC since databases rather commonly
> use DECIMAL as database column type.
>
> The net-interest was next to zero which is why I stopped bothering.
I'm finding that this is a problem in education, not desire. Once you
educate developers, they will demand decimal types. Unfortunately, I've
found that many db developers are completely ignorant of the caveats of both
fixed and floating point arithmetic. They naively "just want things to
work" and aren't too worried about the details or the corner-cases. (I
blame this on the cruddy computer science content of many CIS degree
programs, but that is a topic for a different rant.)
Nevertheless, I would like to seeing proper fixed point support in the
Python standard library with integration advise in a DB-API extension
standard or PEP. As it is, our applications patch many of the DB-API
modules to add support for our own homebrew decimal types, and it is fairly
cumbersome to maintain.
> I may still continue due to reasons of roundtrip safety in
> database interfacing, but I'm inclined to believe that Python
> users in the financial business either have no interest or
> have found their own particular solutions to the problem of
> dealing with fixed point arithmetic [...]
We (my company) are in the latter camp. However, I've talked to a number of
developers who decided not to use Python for financial apps because DB-API
drivers punt on decimal types. Maybe that is why it is so quiet on this
front?
Regards,
-Kevin
--
--
Kevin Jacobs
The OPAL Group - Enterprise Systems Architect
Voice: (216) 986-0710 x 19 E-mail: jacobs@theopalgroup.com
Fax: (216) 986-0714 WWW: http://www.theopalgroup.com