[Python-ideas] Deprecate the round builtin

M.-A. Lemburg mal at egenix.com
Wed Sep 26 21:36:54 CEST 2012

Mark Dickinson wrote:
> On Wed, Sep 26, 2012 at 7:51 PM, Mike Graham <mikegraham at gmail.com> wrote:
>> 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.

Marc-Andre Lemburg

Professional Python Services directly from the Source  (#1, Sep 26 2012)
>>> Python/Zope Consulting and Support ...        http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
2012-10-29: PyCon DE 2012, Leipzig, Germany ...            33 days to go
2012-10-23: Python Meeting Duesseldorf ...                 27 days to go
2012-09-26: Released mxODBC.Connect 2.0.1 ...     http://egenix.com/go34
2012-09-25: Released mxODBC 3.2.1 ...             http://egenix.com/go33

   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
    D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
           Registered at Amtsgericht Duesseldorf: HRB 46611

More information about the Python-ideas mailing list