Mark Dickinson <dicki...@gmail.com> added the comment: This is definitely a feature request rather than a bug.
As I understand it, you want to special-case floor division so that if the argument types are (int, float) or (float, int) then the result is computed exactly. Is that correct? Note that the result of the floor division in your examples is a float, so it won't always be able to represent the result exactly anyway. Or are you also proposing to change the return type to int/long? What should (2**55-2)//2.0 return with your proposed change, and why? Why single out floor division for this treatment? What about the other binary operations? I think this change adds complication to the language semantics without giving significant benefits. It's true that there are a couple of places in Python that *do* special-case integers instead of converting to float (I'm thinking particularly of int <-> float comparisons, and math.log), but there are good reasons for those special cases and I don't think we should add to them. Big -1 from me, I'm afraid. ---------- type: behavior -> feature request versions: +Python 2.7, Python 3.2 -Python 2.6 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue6387> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com