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

Stefan Behnel stefan_ml at behnel.de
Thu Oct 22 18:41:03 CEST 2009


Stefan Krah wrote:
> Mark Dickinson wrote:
>> I think my biggest concern is maintenance:  we'd be replacing
>> 8500 lines of Python code in a single file, that several of the
>> current core developers understand well, with 30000 (Stefan, is
>> that about accurate?) lines of C in several files, that presumably
>> none of the current core devs is familiar with right now.
> 
> Ok, I think we could say that the sloc-counts are around 2600 lines of
> Python vs. around 11500-12500 lines of C.

If maintenance is an issue, I would actually propose to compile the
existing decimal.py using Cython (works with a few trivial modifications),
add a few type decorators at the hot spots to make them really fast, and
then use that as both the Python implementation and fast binary module.

Stefan



More information about the Python-Dev mailing list