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

Christian Heimes lists at cheimes.de
Fri Aug 15 18:31:20 EDT 2008


Robert Kern wrote:
> I think you could make the dictionary created lazily on the first getattr().

In order to make it work you have to reserve space for a PyObject* 
pointer for the instance dict somewhere in your type definition. It's 
going to increase the size of every object by 4 bytes on a 32bit OS or 8 
bytes on a 64bit OS, aka sizeof(uintptr_t). An empty dict increases the 
size of every object by ~30 byte.

Christian




More information about the NumPy-Discussion mailing list