[Numpy-discussion] Warnings as exceptions?

Travis E. Oliphant oliphant@enthought....
Tue Nov 13 10:46:04 CST 2007


Michael McNeil Forbes wrote:
> Why are numpy warnings printed rather than issued using the standard  
> warnings library?  I know that the behaviour can be controlled by  
> seterr(), but it seem rather unpythonic not to use the warnings library.
>
>   
The "warn" option explicitly allows you to use the warnings library.   
There is already the "print" mode which is in fact the default.  It is 
trivial to change your default to "warn" if you prefer.    The standard 
default is "print" because it is less intrusive and does not require 
users to setup the warnings module which is not always done by many users.

-Travis O.




More information about the Numpy-discussion mailing list