RE: [Python-Dev] Re: Decimal data type issues
Tim writes:
But, the PEP is for implementing the Spec, so I'm +1 to drop round(), at least in this stage.
Me too. But let's promise that the docs will include an example of how to use quantize() to do rounding, since the name will not be obvious to the uninitiated. -- Michael Chermside
[Michael Chermside]
Me too. But let's promise that the docs will include an example of how to use quantize() to do rounding, since the name will not be obvious to the uninitiated.
I agree it won't. In some ways it's nicer than round(), because it works by providing an example of the scale you want, not by making you count positions from the decimal point. BTW, note that the spec has nothing to say about how an implementation spells anything, except for the results of the to-string operations. That is, there's no requirement to *call* the spec's quantize operation "quantize"; the requirement is to provide something with the semantics of the spec's quantize operation. For example, round_like() or rescale() might be friendlier names (in fact, the current quantize used to be called rescale in the spec).
participants (2)
-
Michael Chermside
-
Tim Peters