This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mark.dickinson
Recipients drj, eric.smith, mark.dickinson, tim.peters
Date 2009-06-30.13:05:40
SpamBayes Score 0.0
Marked as misclassified No
Message-id <1246367142.61.0.881336730265.issue6387@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2009-06-30 13:05:42mark.dickinsonsetrecipients: + mark.dickinson, tim.peters, eric.smith, drj
2009-06-30 13:05:42mark.dickinsonsetmessageid: <1246367142.61.0.881336730265.issue6387@psf.upfronthosting.co.za>
2009-06-30 13:05:41mark.dickinsonlinkissue6387 messages
2009-06-30 13:05:40mark.dickinsoncreate