Mark Dickinson <dicki...@gmail.com> added the comment:

> if math.gcd() only accepts integers and not, at least, numbers.Integral, 
> wouldn't that be a bug?

I'd call it an enhancement opportunity rather than a bug. :-) There's no 
general Python-wide requirement that an instance of numbers.Integral should be 
acceptable anywhere an int is (though I agree that it's a nice property to have 
in general).

But as it happens, math.gcd _does_ accept instances of numbers.Integral, since 
any such instance should implement the __index__ method to convert itself to a 
plain old int, and math.gcd passes its arguments through PyNumber_Index.

----------

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

Reply via email to