<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 3, 2014 at 3:00 PM, Nathaniel Smith <span dir="ltr"><<a href="mailto:njs@pobox.com" target="_blank">njs@pobox.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="">On Fri, Oct 3, 2014 at 5:13 AM, Charles R Harris<br>
<<a href="mailto:charlesr.harris@gmail.com">charlesr.harris@gmail.com</a>> wrote:<br>
><br>
> On Thu, Oct 2, 2014 at 10:12 PM, Charles R Harris<br>
> <<a href="mailto:charlesr.harris@gmail.com">charlesr.harris@gmail.com</a>> wrote:<br>
</span><span class="">> Plus the g*dawful warning default to only warn once. That has always<br>
> bothered me, it just seems useless.<br>
<br>
</span>I believe the idea is to only warn once per source location, i.e. if<br>
you write something like:<br>
<br>
z = np.zeros(())<br>
for foo in range(1000):<br>
   z / z<br>
z / z<br>
<br>
then you're supposed to get two warnings, for the two lines that<br>
contain divide-by-zero.<br></blockquote><div><br></div><div>What I want is that the following script would warn three times<br><br><span style="font-family:courier new,monospace">import numpy as np<br><br>z = np.zeros(1, dtype=<a href="http://np.int">np.int</a>)<br><br>def f(x):<br>    return x/x<br><br>f(z)<br>f(z)<br>f(z)<br></span></div><div><br></div><div>But it only warns once. That is not helpful when f gets called with an erroneous argument from different places.<br><br></div><div><snip><br><br></div><div>Chuck<br></div></div></div></div>