[Numpy-discussion] Assigning complex values to a real array

Charles R Harris charlesr.harris at gmail.com
Thu Dec 10 14:44:41 EST 2009


Hi Pauli,

On Thu, Dec 10, 2009 at 12:34 PM, Pauli Virtanen <pav at iki.fi> wrote:

> to, 2009-12-10 kello 10:18 -0600, Robert Kern kirjoitti:
> > On Thu, Dec 10, 2009 at 04:24, Pauli Virtanen <pav+sp at iki.fi<pav%2Bsp at iki.fi>>
> wrote:
> > > Thu, 10 Dec 2009 09:54:32 +0100, Dag Sverre Seljebotn wrote:
> > > [clip]
> > >> At this point I want to remind us about Charles Harris' very workable
> > >> proposal: Raise a warning. That should both keep backward
> compatability
> > >> and prevent people from wasting days. (Hopefully, we can avoid wasting
> > >> days discussing this issue too :-) ).
> > >
> > > Yes. We can even make it a PendingDeprecationWarning, when we become
> > > convinced that this feature should go away in entirety.
> >
> > PendingDeprecationWarnings are off by default, I think.
>
> So it seems.
>
> r7993 makes Numpy to raise a custom ComplexWarning when these things
> occur. It's easy for the user to change that into an error or silence
> it.
>
>
You need a small fixup to support python-2.4. For instance, the deprecation
warning is implemented as:

#if PY_VERSION_HEX >= 0x02050000
#define DEPRECATE(msg) PyErr_WarnEx(PyExc_DeprecationWarning,msg,1)
#else
#define DEPRECATE(msg) PyErr_Warn(PyExc_DeprecationWarning,msg)
#endif

Thanks for settling this discussion ;)

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


More information about the NumPy-Discussion mailing list