<div dir="ltr"><div><div><div>It seems .as_integer_ratio() has been resolved.<br><br></div>what about the original .is_integer() request? (Or did I miss that somehow?)<br><br></div>Anyway, it seems like __index__() should play a role here somehow... isn't that how you ask an object for the integer version of itself?<br><br></div><div>Could float et al. add an __index__ method that would return a ValueError if the value was not an integer?<br><br></div><div>Of course, as pointed out earlier in this thread, an "exact" integer is probably not what you want with a float anyway....<br><br></div><div>-CHB<br><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 13, 2018 at 10:29 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">[Tim]<br>
<span class="">>> An obvious way to extend it is for Fraction() to look for a special<br>
>> method too, say "_as_integer_ratio()".<br>
<br>
</span>[Greg Ewing]<br>
> Why not __as_integer_ratio__?<br>
<br>
Because. at this point, that would be beating a dead horse ;-)<br>
<div class="HOEnZb"><div class="h5">______________________________<wbr>_________________<br>
Python-Dev mailing list<br>
<a href="mailto:Python-Dev@python.org">Python-Dev@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-dev" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/listinfo/python-dev</a><br>
Unsubscribe: <a href="https://mail.python.org/mailman/options/python-dev/chris.barker%40noaa.gov" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/options/python-dev/<wbr>chris.barker%40noaa.gov</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><br>Christopher Barker, Ph.D.<br>Oceanographer<br><br>Emergency Response Division<br>NOAA/NOS/OR&R            (206) 526-6959   voice<br>7600 Sand Point Way NE   (206) 526-6329   fax<br>Seattle, WA  98115       (206) 526-6317   main reception<br><br><a href="mailto:Chris.Barker@noaa.gov" target="_blank">Chris.Barker@noaa.gov</a></div>
</div>