[Python-Dev] Rounding Decimals

Jeffrey Yasskin jyasskin at gmail.com
Mon Jan 7 03:03:01 CET 2008


On Jan 6, 2008 5:13 PM, Raymond Hettinger <python at rcn.com> wrote:
> FWIW, I don't think all of these patches are helpful.  The implementations are so easy and the effects are so obvious, that it is
> simply better to decide what to do first, then do it afterwards.
>
> My own preference is to leave the decimal module alone (except for a __round__ method to be called by builtin.round).

You must mean __trunc__ to support builtin.trunc(), since
builtin.round no longer calls __round__ in 2.6. The other 3 methods
specified by PEP 3141 aren't strictly necessary for 2.6, but they will
be needed for 3.0. I'd rather not make the two versions of Decimal
gratuitously different, so this patch puts them in the 2.6 version
too. That's basically all of the changes in this patch, so I'm not
sure exactly what you're objecting to. Could you be more precise?

-- 
Namasté,
Jeffrey Yasskin


More information about the Python-Dev mailing list