[Python-ideas] Deprecate the round builtin
Case Van Horsen
casevh at gmail.com
Mon Oct 1 00:08:07 CEST 2012
On Sun, Sep 30, 2012 at 2:51 PM, Joshua Landau
<joshua.landau.ws at gmail.com> wrote:
> On 30 September 2012 22:48, Joshua Landau <joshua.landau.ws at gmail.com>
> wrote:
>>
>> This seems like a problem for the proposal, though: we can't have it in
>> the math library if it's a method!
>
>
> Now I think about it: yeah, it can be. We just coerce to float/decimal
> first. *sigh*
math.ceil(x), math.floor(x), and math.trunc(x) and round(x) already
call the special methods x.__ceil__, x.__floor__, x.__round__, and
x.__trunc__. So those four functions already work with decimal
instances (and other numeric types that support those methods.)
casevh
>
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> http://mail.python.org/mailman/listinfo/python-ideas
>
More information about the Python-ideas
mailing list