[Numpy-discussion] ANN: MaskedArray as a subclass of ndarray -?followup

Travis Oliphant oliphant at ee.byu.edu
Fri Jan 19 16:30:43 EST 2007


Matt Knox wrote:

>>Moving the implementation to the C-level also has its downside.  To
>>me, at least, Python code is much more readable and hence easier to
>>maintain.
>>
>>Is there a way that we can implement only the speed-critical methods
>>in C?
>>
>>Cheers
>>Stéfan
>>
>>    
>>
>
>Implementing the whole thing in C also has the side benefit of the possibility
>making a nice C level api available to these sub-classes. And I suspect the core
>numpy developers are comfortable enough with C that maintainability is
>*probably* not a huge concern here.
>
>But yeah, implementing even just the speed critical parts in C would still be a
>nice improvement.
>  
>
Part of the trouble is that sometimes the speed critical parts are how 
slow Python functions (e.g. __getitem__) are.    You want to avoid that 
function call and the only way to do that (that I know of) is to create 
the sub-class in C.

-Travis




More information about the NumPy-Discussion mailing list