[Numpy-discussion] Addition of a dict object to all NumPy objects

Travis E. Oliphant oliphant@enthought....
Fri Aug 15 14:58:42 CDT 2008


Hello all,

While we are on the subject of C-API changes,  I've noticed that quite a 
few of the sub-classes of ndarray are constructed to basically add 
meta-information to the array. 

What if the base-class ndarray grew a dict object at it's end to hold 
meta information.  

Naturally, several questions arise:

1) How would you access the dictionary?  (i.e. __dict__?)

2) Would attribute setting and getting retrieve from this dictionary 
(how are conflicts managed).
      * I think I would prefer a dict attribute on the numpy array that 
gets and sets into the dictionary.

3) Are the additional 4-8 bytes too expensive

4) Should there instead be a C-level array sub-class with the dict 
attached.

5) How should dict's be propagated through views?   My preference is to 
not propagate them at all.


Thoughts?


-Travis








More information about the Numpy-discussion mailing list