Uh oh!
There was an error while loading. Please reload this page.
bpo-38639: Optimize floor(), ceil() and trunc() for floats. - #16991
Conversation
Uh oh!
There was an error while loading. Please reload this page.
mdickinson
left a comment
There was a problem hiding this comment.
Proposed changes LGTM. For things of exact type float (and possibly also for float subclasses), I think we could dispense with the math_1_to_int complications to get even more speedup. But that doesn't have to happen in this PR.
Do we have tests for the various cases of floats, float subclasses that don't override __floor__, float subclasses that do override __floor__, things that aren't floats but provide a __float__ method, etc.? If not, would it be worth adding such tests?
mdickinson
commented
Oct 30, 2019
It occurs to me that I don't know how a subclass of |
serhiy-storchaka
commented
Nov 7, 2019
I think that it would be better to not call |
serhiy-storchaka
commented
Nov 7, 2019
Thank you for your review @mdickinson, I addressed your comments and added tests. Could you please take another look? |
https://bugs.python.org/issue38639