<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Mar 12, 2018 at 10:01 PM, Tim Peters <span dir="ltr"><<a href="mailto:tim.peters@gmail.com" target="_blank">tim.peters@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
At heart, the Fraction() constructor is _all about_ creating integer<br>
ratios, so is the most natural place to put knowledge of how to do so.<br>
A protocol for allowing new numeric types to get converted to Fraction<br>
would be more generally useful than just a weird method only datetime<br>
uses ;-)<br>
</blockquote></div><br></div><div class="gmail_extra">Ironically, the various Fraction constructors *calls* as_integer_ratio() for floats and Decimals. From which follows IMO that the float and Decimal classes are the right place to encapsulate the knowledge on how to do it.<br clear="all"></div><div class="gmail_extra"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">--Guido van Rossum (<a href="http://python.org/~guido" target="_blank">python.org/~guido</a>)</div>
</div></div>