[Python-Dev] Interest in integrating C decimal module into Python?

Stefan Krah stefan-usenet at bytereef.org
Tue Oct 20 15:15:47 CEST 2009


as some of you know, recently I've released an arbitrary precision
C library for decimal arithmetic together with a Python module:


Both the library and the module have been tested extensively. Fastdec
currently differs from decimal.py in a couple of ways that could be
fixed. The license is AGPL, but if there is interest in integrating it
into Python I'd release it under a Python-compatible license.

There have been several approaches towards getting C decimal arithmetic
into Python:


Fastdec follows Raymond Hettinger's suggestion to provide wrappers for
an independent C implementation. Arguments in favour of fastdec are:

  * Complete implementation of Mike Cowlishaw's specification

  * C library can be tested independently

  * Redundant arithmetic module for tests against decimal.py

  * Faster than Java BigDecimal

  * Compares relatively well in speed against gmpy

To be clear, I would not want to _replace_ decimal.py. Rather I'd like to
see a cdecimal module alongside decimal.py.

I know that ultimately there should be a PEP for module inclusions. The
purpose of this post is to gauge interest. Specifically:

1. Are you generally in favour of a C decimal module in Python?

2. Would fastdec - after achieving full decimal.py compatibility - be
   a serious candidate?

3. Could I use this list to settle a couple of questions, or would perhaps
   a Python developer be willing to work with me to make it compatible? I'm
   asking this to avoid doing work that would not find acceptance afterwards.


Stefan Krah

More information about the Python-Dev mailing list