<div dir="ltr">As requested on the bug tracker, I've submitted a pull request for is_integer() support on the other numeric types. <a href="https://github.com/python/cpython/pull/6121">https://github.com/python/cpython/pull/6121</a> <div><br></div><div>These are the tactics I used to implement it:<div><br></div><div>- float: is_integer() already exists, so no changes<br></div><div><br></div><div>- int:  return True</div><div><br></div><div>- Real: return x == int(x). Although Real doesn't explicitly support conversation to int with __int__, it does support conversion to int with __trunc__. The int constructor falls back to using __trunc__.</div><div><br></div><div>- Rational (also inherited by Fraction): return x.denominator == 1 as Rational requires that all numbers must be represented in lowest form.</div><div><br></div><div>- Integral: return True</div><div><br></div><div>- Decimal: expose the existing dec_mpd_isinteger C function to Python as is_integer()</div><div><br></div></div></div>