Mark Dickinson added the comment:

To avoid regressions, please can we leave the old `fractions.gcd` exactly as it 
was?  

For example, the current `fractions.gcd` *does* work for Fraction instances 
[1].  That's certainly not its intended use, but I wouldn't be surprised if 
there's code out there that uses it in that way.  It also just happens to work 
for nonnegative finite float inputs, because a % b gives exact results when a 
and b are positive floats, so no error is introduced at any point.

I'd also worry about breaking existing uses involving integer-like objects 
(instances of numpy.int64, for example) in place of instances of ints.

[1] By "works", I mean that if a and b are Fractions then gcd(a, b) returns a 
Fraction such that (1) a and b are integer multiples of gcd(a, b), and (2) 
gcd(a, b) is an integer multiple of any other number with this property.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue22486>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to