[Python-ideas] Deprecate the round builtin

Joao S. O. Bueno jsbueno at python.org.br
Wed Sep 26 23:00:24 CEST 2012

> On Wed, Sep 26, 2012 at 3:36 PM, M.-A. Lemburg <mal at egenix.com> wrote:
>> It's actually quite common in finance and time calculations to
>> round to the nearest say basis point, cent or say micro second
>> in calculations (rather than just string formatting). round()
>> is perfect for that and easy to use.

On the other hand, having round with a second parameter to return a Decimal
would be quite usefull. I can't see a way of changing the type returned
by the built-in round without crashing half the World --- but maybe it would
be possible to deprecate only the two-parameter form of the built-in round,
and add a decimal.round Decimal factory?


More information about the Python-ideas mailing list