[SciPy-dev] Default type behaviour of array

Fernando Perez Fernando.Perez at colorado.edu
Sun Nov 13 04:28:15 EST 2005


Alan G Isaac wrote:

> 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).

Yes, a 'debug mode' would certainly be nice.  Both f2py (--debug-capi) and 
blitz++ (the BZDEBUG macro) have debug modes which, while typically very 
verbose and/or slow (blitz grinds to a crawl in this mode), can be absolute 
life-savers when you really need them.  I can think of a couple of ways of 
doing this, but it would require writing code in the internals which I'm not 
exactly volunteering for right now :)

Cheers,

f




More information about the SciPy-Dev mailing list