[Python-Dev] Re: Decimal data type issues

Michael Chermside mcherm at mcherm.com
Fri Apr 23 09:10:10 EDT 2004

Tim Peters writes:
> 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.

Without having given it a LOT of thought, I'm in favor of calling it
"quantize" just to match the name in the spec. Without deciding it yet,
there are good reasons to think we MIGHT want the behavior of "round"
to be somewhat different (eg: match the behavior of Python's round())
if that were supported in the future.

> For example, round_like() or rescale() might
> be friendlier names (in fact, the current quantize used to be called rescale
> in the spec).

Yes, but there are ALSO notes in the spec explaining that they changed
the name from rescale to quantize because people had misleading
preconceptions about what "rescale" would do. (Partly because it worked
differently in previous versions of the spec.)

-- Michael Chermside

More information about the Python-Dev mailing list