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 steven.daprano
Recipients akira,, gladman, mark.dickinson, scoder, steven.daprano, vstinner
Date 2014-09-24.12:05:39
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I would be a lot more cautious about changing the gcd function. As Mark says, there is *not* a single well-defined meaning of the gcd for negative arguments. Even Wolfram can't decide which to use: Mathworld gives one interpretation, Mathematica the opposite. See my comments here:
Given that there is no one definitive definition of gcd, this is not a bug fix, it is a backward-incompatible functional change. That means it ought to go through a deprecation period before changing it:

- deprecate negative arguments in 3.5;
- raise a warning in 3.6;
- change the behaviour in 3.7.

*Maybe* we could skip the silent deprecation period and jump straight to the warning. But I don't see any justification for fast-tracking this, and certainly not for jumping straight to the change of behaviour. Somebody is using this function and expects it to do what it currently does, and changing it will break their code for precious little benefit.

Another objection: this suggested change will add yet another backwards incompatibility between Python 2.7 and 3.x. There ought to be a good reason for that, not just to save a single call to abs() after gcd.

I am -1 on making this change.
Date User Action Args
2014-09-24 12:05:39steven.dapranosetrecipients: + steven.daprano, mark.dickinson, scoder, vstinner, akira, gladman,
2014-09-24 12:05:39steven.dapranosetmessageid: <>
2014-09-24 12:05:39steven.dapranolinkissue22477 messages
2014-09-24 12:05:39steven.dapranocreate