[Numpy-discussion] Please help with subclassing numpy.ndarray

Travis Oliphant oliphant@ee.byu....
Wed Feb 7 18:07:55 CST 2007


Sturla Molden wrote:

>>Good point.  I guess I thought the OP had tried that already.  It turns
>>out it works fine, too.
>>
>>The __array_finalize__ is useful if you want the attribute to be carried
>>around when arrays are created automatically internally (after math
>>operations for example).
>>    
>>
>
>I too may be missing something here.
>
>Will using __array_finalize__ this way be thread safe or not?
>  
>
Yes because __array_finalize__ is called while NumPy owns the GIL.   It 
is called in one place during array creation (in the C routine that all 
array-creation routines call).

-Travis



More information about the Numpy-discussion mailing list