[Numpy-discussion] robustness strategies

David Cournapeau david at ar.media.kyoto-u.ac.jp
Wed Oct 7 23:08:42 EDT 2009


Alan G Isaac wrote:
> On 10/7/2009 10:51 PM, David Cournapeau wrote:
>   
>> pimp-like strategies
>>     
>
>
> Which means ... ?
>   

The idea is to put one pointer in you struct instead of all members - it
is a form of encapsulation, and it is enforced at compile time. I think
part of the problem with changing API/ABI in numpy is that the headers
show way too much information. I would really like to improve this, but
this would clearly break the ABI (and API - a lot of macros would have
to go).

There is a performance cost of one more indirection (if you have a
pointer to a struct, you need to dereference both the struct and the D
pointer inside), but for most purpose, that's likely to be negligeable,
except for a few special cases (like iterators).

cheers,

David



More information about the NumPy-Discussion mailing list