[Numpy-discussion] Warnings as exceptions?
Travis E. Oliphant
oliphant at enthought.com
Tue Nov 13 11:46:04 EST 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.
More information about the NumPy-Discussion