Message309306
> 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. |
|
Date |
User |
Action |
Args |
2017-12-31 20:38:10 | mark.dickinson | set | recipients:
+ mark.dickinson, rhettinger, gphemsley |
2017-12-31 20:38:10 | mark.dickinson | set | messageid: <1514752690.33.0.467229070634.issue32466@psf.upfronthosting.co.za> |
2017-12-31 20:38:10 | mark.dickinson | link | issue32466 messages |
2017-12-31 20:38:10 | mark.dickinson | create | |
|