[SciPy-Dev] why this not report an error for a.dtype=float when a is mixed struc array

Stéfan van der Walt stefan@sun.ac...
Sat Jun 5 22:08:18 CDT 2010

On 5 June 2010 08:49, Vincent Davis <vincent@vincentdavis.net> wrote:
>> You might find this thread helpful.  Especially, Chris's reply.
>> http://thread.gmane.org/gmane.comp.python.numeric.general/32664/
> Ok now I understand why, that is why the numbers are a mess but not
> why it is a feature :) I guess I am try to think of why I would use
> this. I might be completely wrong but if most users would expect a
> different behavior and don't notice what is actually happening then
> maybe there should be a warning and a different way to get the current
> results.

There are many uses for 'view', such as examining underlying bytes or
changing the subclass of an array without copying.

I'm not sure I follow your argument, though.  'view' and 'astype' do
distinctly different things (well defined), and are both necessary for
advanced array computation.  An array is simply a wrapper around
memory, and it should not be too magical.


More information about the SciPy-Dev mailing list