Jeffrey Yasskin <jyass...@gmail.com> added the comment: When PEP 3141 says something should be Real, that includes both int and float as possibilities (since Real is a supertype of Integral), so it's consistent with the PEP for round(int, int) to return an int, and I agree with Mark that round(25, -1) ought to return an int. Making that change would be slightly backwards-incompatible, but IIRC, int is supposed to be usable everywhere float is, so there should be very few programs it would break. So my vote's to change it, for 3.0.1 if possible.
The documentation is a little too strict on __round__ implementations by requiring round(x, y) to return the same type as x, but I think it should still encourage __round__ to return the same type. And, uh, oops for writing those bugs. Is your guess for round(25.0, -1)==30.0 that 25.0*(1/10.0) is slightly more than 2.5 on some systems? _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue4707> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com