<div dir="auto"><div>If anyone cares, my vote is to rip out both .as_integer_ratio() and .is_integer() from Python. I've never used either and wouldn't want to.<br><br>Both seem like perfectly good functions for the `math` module, albeit the former is simply the Fraction() constructor.</div><div dir="auto"><br></div><div dir="auto">I can see no sane reason why anyone would ever call float.is_integer() actually. That should always be spelled math.isclose(x, int(x)) because IEEE-754. Attractive nuisance is probably too generous, I'd simply call the method a bug.<br><br><div class="gmail_quote" dir="auto"><div dir="ltr">On Mon, Mar 12, 2018, 2:21 PM Tim Peters <<a href="mailto:tim.peters@gmail.com" target="_blank" rel="noreferrer">tim.peters@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">[Guido]<br>
> .... as_integer_ratio() seems mostly cute (it has Tim Peters all<br>
> over it),<br>
<br>
Nope! I had nothing to do with it. I would have been -0.5 on adding<br>
it had I been aware at the time.<br>
<br>
- I expect the audience is tiny.<br>
<br>
- While, ya, _I_ have uses for it, I had a utility function for it<br>
approximately forever (it's easily built on top of math.frexp()).<br>
<br>
- Especially now, fractions.Fraction(some_float) is the same thing<br>
except for return type.<br>
<br>
<br>
> OTOH it looks like Decimal has it,<br>
<br>
Looks like ints got it first, and then spread to Decimal because "why<br>
not?" ;-) The first attempt to spread it to Decimal I found was<br>
rejected (which would have been my vote too):<br>
<br>
<a href="https://bugs.python.org/issue8947" rel="noreferrer noreferrer noreferrer" target="_blank">https://bugs.python.org/issue8947</a><br>
<br>
<br>
> so I think this ship has sailed too and maybe it's best to add it to the<br>
> numeric tower just to be done with it.<br>
<br>
Or rip it out of everything. Either way works for me ;-)<br>
_______________________________________________<br>
Python-Dev mailing list<br>
<a href="mailto:Python-Dev@python.org" rel="noreferrer noreferrer" target="_blank">Python-Dev@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-dev" rel="noreferrer noreferrer noreferrer" target="_blank">https://mail.python.org/mailman/listinfo/python-dev</a><br>
Unsubscribe: <a href="https://mail.python.org/mailman/options/python-dev/mertz%40gnosis.cx" rel="noreferrer noreferrer noreferrer" target="_blank">https://mail.python.org/mailman/options/python-dev/mertz%40gnosis.cx</a><br>
</blockquote></div></div></div>