[Python-ideas] Deprecate the round builtin

Amaury Forgeot d'Arc amauryfa at gmail.com
Wed Sep 26 23:32:52 CEST 2012

2012/9/26 M.-A. Lemburg <mal at egenix.com>:
>>>>> round(2.675, 2)
>> 2.67
>> So you end up explaining again and again that computing binary
>> approximations to decimal rounds of binary approximations of decimal
>> halfway cases is a bad idea.
> But that's the fault of round(), is it ? ;-) It's more one of
> educating people of what to expect when working with floats.

Could we change the round() behavior?
The second parameter is the number of decimal places,
so the operation could be defined in terms of decimal digits.

A similar change was already done for float.__str__.

Amaury Forgeot d'Arc

More information about the Python-ideas mailing list