[Python-ideas] Deprecate the round builtin

Joshua Landau joshua.landau.ws at gmail.com
Sun Sep 30 23:48:21 CEST 2012


On 30 September 2012 22:38, Gregory P. Smith <greg at krypto.org> wrote:

> Why suggest adding new round-like functions to the math module rather than
> defining a new round method on all numerical objects?


 >>> round("")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: type str doesn't define __round__ method

It seems it is done like that already ;)
This seems like a problem for the proposal, though: we can't have it in the
math library if it's a method!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20120930/df082114/attachment.html>


More information about the Python-ideas mailing list