[Numpy-discussion] add .H attribute?

Nathaniel Smith njs at pobox.com
Tue Jul 23 12:10:52 EDT 2013

On 23 Jul 2013 16:03, "Pauli Virtanen" <pav at 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?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20130723/301030f1/attachment.html>

More information about the NumPy-Discussion mailing list