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 mark.dickinson
Recipients gphemsley, mark.dickinson, rhettinger
Date 2017-12-31.20:38:10
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1514752690.33.0.467229070634.issue32466@psf.upfronthosting.co.za>
In-reply-to
Content
> 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.
History
Date User Action Args
2017-12-31 20:38:10mark.dickinsonsetrecipients: + mark.dickinson, rhettinger, gphemsley
2017-12-31 20:38:10mark.dickinsonsetmessageid: <1514752690.33.0.467229070634.issue32466@psf.upfronthosting.co.za>
2017-12-31 20:38:10mark.dickinsonlinkissue32466 messages
2017-12-31 20:38:10mark.dickinsoncreate