[Python-Dev] Decimal floats as default (was: discussion about PEP239 and 240)

Fredrik Johansson fredrik.johansson at gmail.com
Wed Jun 22 22:19:39 CEST 2005


On 6/22/05, Skip Montanaro <skip at pobox.com> wrote:
> If nothing else, extension module code that executes
> 
>     f = PyFloat_AsDouble(o);
> 
> or
> 
>     if (PyFloat_Check(o)) {
>        ...
>     }
> 
> would either have to change or those functions would have to be rewritten to
> accept Decimal objects and convert them to doubles (probably silently,
> because otherwise there would be so many warnings).
> 

Silent conversion was the idea.

> Like Michael wrote, I think this idea is DOA.

Granted, then.

However, keeping binary as default does not kill the other idea in my
proposal, which is to extend the float type to cover decimals instead
of having a separate decimal type. I consider this a more important
issue (contradicting the thread title :-) than whether "d" should be
needed to specify decimal precision.

Fredrik


More information about the Python-Dev mailing list