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 tim.peters
Recipients Sergey.Kirpichev, asmeurer, mark.dickinson, rhettinger, terry.reedy, tim.peters
Date 2021-03-13.04:19:33
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1615609173.35.0.540714620235.issue43420@roundup.psfhosted.org>
In-reply-to
Content
Terry, we could do that, but the opposition here isn't strong, and is pretty baffling anyway ;-) : the suggested changes are utterly ordinary for implementations of rationals, require very little code, are not delicate, and are actually straightforward to see are correct (although unfamiliarity can be an initial barrier - e.g., if you don't already know that after

     g = gcd(a, b)
     a1 = a // g
     b1 = b // g

it's necessarily true that a1 and b1 are coprime, a key reason for way the transformation is correct will be lost on you - but it's also very easy to prove that claim once you're told that it is a key here). The OP is right that "we" (at least Mark, and Raymond, and I) have routinely checked in far subtler optimizations in various areas.
History
Date User Action Args
2021-03-13 04:19:33tim.peterssetrecipients: + tim.peters, rhettinger, terry.reedy, mark.dickinson, Sergey.Kirpichev, asmeurer
2021-03-13 04:19:33tim.peterssetmessageid: <1615609173.35.0.540714620235.issue43420@roundup.psfhosted.org>
2021-03-13 04:19:33tim.peterslinkissue43420 messages
2021-03-13 04:19:33tim.peterscreate