[SciPy-dev] Default type behaviour of array

Alan G Isaac aisaac at american.edu
Sat Nov 12 07:06:06 CST 2005


> Jonathan Taylor wrote: 
>> Also, maybe it should complain when you put floats into 
>> an integer array instead of just rounding the elements.  
>> That is, maybe you should have to explicity round the 
>> elements? 

On Sat, 12 Nov 2005, Fernando Perez apparently wrote: 
> I think that, while perhaps a bit surprising at first, 
> this is one of those cases where you just have to 'learn 
> to use the library'.  The point is that you should think 
> of scipy arrays as C-style, strongly typed variables.  
> interpolation codes, for example). ... I would not want 
> a typecheck made on every assginment, as every layer of 
> safety added to arrays carries a performance price.

It seems reasonable to be able to "turn on" type checking as 
part of a debugging facility, however.  Especially when 
silent truncation is likely to surprise some users (as in 
this case).

Cheers,
Alan Isaac







More information about the Scipy-dev mailing list