[Python-Dev] Decimal(unicode)

Nick Coghlan ncoghlan at gmail.com
Wed Mar 26 07:57:22 CET 2008

Greg Ewing wrote:
> I thought Decimal was going to be replaced by a C
> implementation soon anyway. If so, is it worth going
> to much trouble over this?

I believe that was found to be more trouble than it was worth. So the 
optimisations focused on various ways of making the Python 
implementation more efficient.

One of those ways was to store the mantissa as a string in order to gain 
the benefit of the fast str->int and int->str conversions. The 3.0 
version no longer has that benefit, and it shows.

It looks like it may be necessary to switch to a custom object for the 
mantissa storage in order to get those fast conversions back.


Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia

More information about the Python-Dev mailing list