[Numpy-discussion] Inconsistent error messages.

Charles R Harris charlesr.harris at gmail.com
Sat May 23 21:06:59 EDT 2009


On Sat, May 23, 2009 at 6:37 PM, Eric Firing <efiring at hawaii.edu> wrote:

> Charles R Harris wrote:
> >
> >
> > On Sat, May 23, 2009 at 6:03 PM, Robert Kern <robert.kern at gmail.com
> > <mailto:robert.kern at gmail.com>> wrote:
> >
> >     On Sat, May 23, 2009 at 18:57, Charles R Harris
> >     <charlesr.harris at gmail.com <mailto:charlesr.harris at gmail.com>>
> wrote:
> >      > You were supposed to be able to change the default behaviour, but
> >     it didn't
> >      > used to work. I think if you are going to use a warning as a flag
> >     then it
> >      > has to always be raised when a failure occurs, not just the first
> >     time.
> >
> >     A brief test suggest that in Python 2.5.4, at least, as long as you
> >     set the action to be 'always' before the warning is first issued, it
> >     works. We can do this just after the IOWarning (or whatever) gets
> >     defined.
> >
> >
> > OK, that would work. Although I think a named argument might be a more
> > transparent way to specify behaviour than setting the warnings.
>
> I agree; using a warning strikes me as an abuse of the warnings
> mechanism.  Instead of a "strict" flag, which I find not particularly
> expressive--what is it being "strict" about?--how about a "min_count"
> kwarg to go with the existing "count" kwarg?
>

I didn't like the fact that it overlaps with count. Although I suppose it
could be the minimum and count the maximum if we enforce min_count <= count.
But that still seems a bit clumsy.

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20090523/054d0b31/attachment.html>


More information about the NumPy-Discussion mailing list