Message89922
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. |
|
Date |
User |
Action |
Args |
2009-06-30 13:05:42 | mark.dickinson | set | recipients:
+ mark.dickinson, tim.peters, eric.smith, drj |
2009-06-30 13:05:42 | mark.dickinson | set | messageid: <1246367142.61.0.881336730265.issue6387@psf.upfronthosting.co.za> |
2009-06-30 13:05:41 | mark.dickinson | link | issue6387 messages |
2009-06-30 13:05:40 | mark.dickinson | create | |
|