[Python-ideas] Deprecate the round builtin
joshua.landau.ws at gmail.com
Wed Sep 26 21:47:09 CEST 2012
On 26 September 2012 20:36, M.-A. Lemburg <mal at egenix.com> wrote:
> Mark Dickinson wrote:
> > On Wed, Sep 26, 2012 at 7:51 PM, Mike Graham <mikegraham at gmail.com>
> >> The builtin round function is completely useless. I've never seen
> >> anyone use it constructively
> > I disagree that it's *completely* useless: the one-argument form
> > (take a float, return the closest integer) is a fundamental and useful
> > mathematics operation, just like floor and ceiling. It would be crazy
> > to get rid of that. I could live with it moving from builtins into
> > the math module, though.
> > Agreed that the two-argument form causes a lot of confusion, though.
> 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.
Agreed. I've rounded before. It's useful.
Maybe not as useful as all() or whatever, but I don't see how it's
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-ideas