<div dir="ltr"><div><div dir="auto">I know this is all done, but for completeness’ sake:</div><div dir="auto"><br></div><div dir="auto">I just noticed math.trunc() and __trunc__().</div><div dir="auto"><br></div><div dir="auto">So wouldn’t the “correct” way to check for an integral value be something like:</div><div dir="auto"><br></div><div dir="auto">obj.__trunc__() == obj</div><div dir="auto"><br></div><div dir="auto">I don’t think this has any bearing on adding is_integer() methods to numeric objects, but might if we wanted to add a generic is_integer() function somewhere.</div><div dir="auto"><br></div><div dir="auto">In any case, I don’t recall it being mentioned in the conversation, so thought I’d complete the record.</div><div dir="auto"><br></div><div dir="auto">-CHB</div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto"><br></div><div class="gmail_quote"><div>On Wed, Mar 21, 2018 at 8:31 PM Guido van Rossum <<a href="mailto:guido@python.org" target="_blank">guido@python.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="gmail_extra"><div class="gmail_quote">On Wed, Mar 21, 2018 at 6:48 PM, Chris Barker <span><<a href="mailto:chris.barker@noaa.gov" target="_blank">chris.barker@noaa.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><span>On Wed, Mar 21, 2018 at 4:12 PM, Guido van Rossum <span><<a href="mailto:guido@python.org" target="_blank">guido@python.org</a>></span> wrote:<br></span><div class="gmail_extra"><div class="gmail_quote"><span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_extra">Thank you! As you may or may not have noticed in a different thread, we're going through a small existential crisis regarding the usefulness of is_integer() -- Serhiy believes it is not useful (and even an attractive nuisance) and should be deprecated. OTOH the existence of dec_mpd_isinteger() seems to validate to me that it actually exposes useful functionality (and every Python feature can be abused, so that alone should not </div></blockquote></span></div></div></div></blockquote></div></div></div><div><div class="gmail_extra"><div class="m_-8957017912439666426m_4309689890820396371gmail_signature" data-smartmail="gmail_signature">)</div>
</div></div></blockquote></div></div></div>