bpo-37822: Add math.as_integer_ratio(). by serhiy-storchaka · Pull Request #15210 · python/cpython
I think it would be good to define more precisely what are the output types. We require the output of as_integer_ratio to be two integers, but what does "integer" mean in this context? A Python int? An object which implements __index__? An instance of numbers.Integral?
My personal vote would be to require __index__ (I don't mean that we should check that condition, but we should document it).