> So let's make as_integer_ratio() the standard protocol for "how to make a
> Fraction out of a number that doesn't implement numbers.Rational". We
> already have two examples of this (float and Decimal) and perhaps numpy or
> the sometimes proposed fixed-width decimal type can benefit from it too.

Yup, that works.  I only would have preferred that you went back in
time to add a leading underscore.

> If this means we should add it to int, that's fine with me.

Given that int.numerator and int.denominator already exist, there's no
plausible "good reason" to refuse to return them as twople.  Still,
I'd wait for someone to complain ;-)
Python-Dev mailing list

Reply via email to