[Numpy-discussion] Array Interface (original) (raw)
Thomas Heller theller at python.net
Fri Jun 16 15:49:33 EDT 2006
- Previous message (by thread): [Numpy-discussion] Array Interface
- Next message (by thread): [Numpy-discussion] Build questions, atlas, lapack...
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Travis Oliphant wrote:
Thanks for the continuing discussion on the array interface.
I'm thinking about this right now, because I just spent several hours trying to figure out if it is possible to add additional "object-behavior" pointers to a type by creating a metatype that sub-types from the Python PyTypeType (this is the object that has all the function pointers to implement mapping behavior, buffer behavior, etc.). I found some emails from 2002 where Guido indicates that it is not possible to sub-type the PyTypeType object and add new function pointers at the end without major re-writing of Python.
Yes, but I remember an email from Christian Tismer that it is possible. Although I've never tried that.
What I do in ctypes is to replace the type objects (the subclass of PyType_Type) dictionary with a subclass of PyDict_Type (in ctypes it is named StgDictObject
- storage dict object, a very poor name I know) that has additional structure fields describing the C data type it represents.
Thomas
- Previous message (by thread): [Numpy-discussion] Array Interface
- Next message (by thread): [Numpy-discussion] Build questions, atlas, lapack...
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]