[Numpy-discussion] 0/0 == 0?
Charles R Harris
charlesr.harris at gmail.com
Fri Oct 3 17:24:45 EDT 2014
On Fri, Oct 3, 2014 at 3:00 PM, Nathaniel Smith <njs at pobox.com> wrote:
> On Fri, Oct 3, 2014 at 5:13 AM, Charles R Harris
> <charlesr.harris at gmail.com> wrote:
> > On Thu, Oct 2, 2014 at 10:12 PM, Charles R Harris
> > <charlesr.harris at gmail.com> wrote:
> > Plus the g*dawful warning default to only warn once. That has always
> > bothered me, it just seems useless.
> I believe the idea is to only warn once per source location, i.e. if
> you write something like:
> z = np.zeros(())
> for foo in range(1000):
> z / z
> z / z
> then you're supposed to get two warnings, for the two lines that
> contain divide-by-zero.
What I want is that the following script would warn three times
import numpy as np
z = np.zeros(1, dtype=np.int)
But it only warns once. That is not helpful when f gets called with an
erroneous argument from different places.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion