New submission from Raymond Hettinger: The Py2.6 code has __round__, __ceil__, and __floor__ methods still in several objects (int, longs, float, Rational) but they are not invoked by anything. For example, round(Rational(22,7)) does not use the Rational.__round__ code and round(22) does not use the code for int.__round__; the code is just ignored. Since the code is not used, it probably shouldn't be in Py2.6.
I think these backports happened before Guido decided, "I think the pre-3.0 rule should be: round(), math.floor(), math.ceil() *always* return a float." Probably, rev 59731 may have intended to revert these changes but just missed them. IIRC, the decision was that only __trunc__ would be backported and the other three magic methods would wait for Py3.0 where their invocation functions would get their new signature and start calling the magic methods. ---------- assignee: jyasskin messages: 61835 nosy: jyasskin, rhettinger severity: normal status: open title: Unused number magic methods leaked into Py2.6 versions: Python 2.6 __________________________________ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1968> __________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com