On 23 Jul 2013 16:03, "Pauli Virtanen" <p...@iki.fi> wrote:
>
> 23.07.2013 17:51, Nathaniel Smith kirjoitti:
> [clip: conjcomplex dtype]
> > Because this latter cast is safe, all the existing ufuncs would
> > automatically work fine on conjcomplex arrays. But we could also
> > define conjcomplex-specific ufunc loops for cases like dot() where a
> > more efficient implementation is possible (using the above-mentioned
> > BLAS flags).
> >
> > Don't know if we want to actually do this, but it's doable.
>
> There's somewhat a lot of 3rd party code that doesn't do automatic
> casting (e.g. all of Cython code interfacing with Numpy, C extensions,
> f2py I think), but rather fails for incompatible input dtypes. Having
> arrays with a new complex dtype around would require changes in this
> sort of code.
>
> In this sense having an iterator of some sort with an __array__
> attribute would work. However, an iterator doesn't support (without a
> lot of work) the various ndarray attributes which would be confusing.

Surely there's more code that handles unusual but correctly castable dtypes
dtypes than there is code that handles custom iterator objects that are
missing ndarray attributes?

-n
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to