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 scoder
Recipients mark.dickinson, pitrou, scoder, serhiy.storchaka
Date 2014-09-26.07:52:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
The attached patch adds fast paths for PyLong division by 1 and -1, as well as dividing 0 by something. This was found helpful for fractions normalisation, as the GCD that is divided by can often be |1|, but firing up the whole division machinery for this eats a lot of CPU cycles for nothing.

There are currently two test failures in because dividing a huge number by 1 or -1 no longer raises an OverflowError. This is a behavioural change, but I find it acceptable. If others agree, I'll fix the tests and submit a new patch.
Date User Action Args
2014-09-26 07:52:32scodersetrecipients: + scoder, mark.dickinson, pitrou, serhiy.storchaka
2014-09-26 07:52:31scodersetmessageid: <>
2014-09-26 07:52:31scoderlinkissue22501 messages
2014-09-26 07:52:31scodercreate