[Numpy-discussion] Trying to turn warning to errors

Pauli Virtanen pav at iki.fi
Fri May 13 12:54:08 EDT 2011


Fri, 13 May 2011 17:39:26 +0200, Ondrej Marsalek wrote:
[clip]
> while this does not (i.e. still produces just a warning):
> 
> $ python -W error -c 'import numpy; x=numpy.ones(2); x+=1j'
> numpy.core.numeric.ComplexWarning: Casting complex values to real
> discards the imaginary part
> 
> This is with Python 2.6.6 and numpy 1.5.1, but also confirmed with
> Python 2.7.

Hmm, I suspect that there is some code in the type casting path
that swallows exceptions... Seems to also occur on 1.6.0rc3

Can you file a bug ticket on this on the Numpy Trac, so it won't get lost?




More information about the NumPy-Discussion mailing list