<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 13, 2016 at 4:31 AM, Stephan Hoyer <span dir="ltr"><<a href="mailto:shoyer@gmail.com" target="_blank">shoyer@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="">On Wed, Apr 13, 2016 at 12:42 AM, Antony Lee <span dir="ltr"><<a href="mailto:antony.lee@berkeley.edu" target="_blank">antony.lee@berkeley.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>(Note that I am suggesting to switch to the new behavior regardless of the version of Python.)</div></div></blockquote><div><br></div></span><div>I would lean towards making this change only for Python 3. This is arguably more consistent with Python than changing the behavior on Python 2.7, too.</div><div><br></div><div>The most obvious way in which a float being surprisingly switched to an integer could cause silent bugs (rather than noisy TypeErrors) is if the number is used in division. True division in Python 3 eliminates this risk.</div><div><br></div><div>Generally, I agree with your reasoning. It would be unfortunate to be stuck with this legacy behavior forever.</div></div></div></div>
<br></blockquote><div><br></div><div>The difference is that Python 3 has looooong ints, (and doesn't have to overflow, AFAICS) </div><div><br></div><div>what happens with nan?</div><div>I guess inf would overflow?</div><div><br></div><div>(nan and inf are preserved with np.round)</div><div><br></div><div>Josef</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">_______________________________________________<br>
NumPy-Discussion mailing list<br>
<a href="mailto:NumPy-Discussion@scipy.org">NumPy-Discussion@scipy.org</a><br>
<a href="https://mail.scipy.org/mailman/listinfo/numpy-discussion" rel="noreferrer" target="_blank">https://mail.scipy.org/mailman/listinfo/numpy-discussion</a><br>
<br></blockquote></div><br></div></div>