On Sep 21, 2009, at 7:50 PM, Sturla Molden wrote:

>
> I have discovered something peculiar in Cython 0.11.2.
>
> Assume we have
>
>    cdef np.ndarray[np.float64_t] y, z
>
> and do something like
>
>    return (y if (zi is None) else (y, z))
>
> GCC complains about "assignment from incompatible pointer type" when
> compiling the generated C.

Is it just a warning, or does it not compile?

> Whereas if I write this as
>
>    if (zi is None):
>        return y
>    else:
>        return (y,z)
>
> GCC does not complain.
>
> Is this a bug?

Yes, it is. There are way too many warnings when compiling the  
generated c code, and in my mind any such warning is a bug (though  
possibly a low-priority one).

- Robert


_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to