[Python-Dev] Re: Decimal data type issues

Andrew P. Lentvorski, Jr. bsder at allcaps.org
Wed Apr 21 19:57:23 EDT 2004


On Wed, 21 Apr 2004, Batista, Facundo wrote:

> #- Actually, there is no round() operation in the spec.  I
> #- don't remember
> #- whether there used to be, but there definitely isn't now.
...
> Well, I think we must decide how it works

Careful.  Omissions from technical specifications can be as important as
inclusions.

Why is there no round operation in the spec?  Is it that the functionality
can be implemented using existing operations?  Is it that there is no good
definition of the operation (I find this hard to believe)?  Does it have
some strange side effect that causes problems?

I'm betting that the issue is that the performance of round() is dependent
upon the chosen internal representation (ie. rounding a digit
repesentation is O(1) but rounding a binary integer with scale could be
O(n)).  Removing something which is in use but has this kind of subtle
implication is far harder than adding a function later which got omitted.

For this pass, simply staying with the spec is more than sufficient work.
Work which I heartily thank Facundo for doing.

-a



More information about the Python-Dev mailing list