Wed, 28 Jul 2010 18:43:30 -0400, Pierre GM wrote: [clip] > Mmh. I did create a PyMappingMethod structure called MyArray_as_mapping, > and MyArray_as_mapping.mp_subscript points to the function that I want > to use. However, I'd like the MyArray_as_mapping.length and > MyArray.mp_ass_subscript to point to their PyArray equivalent. I was > hoping to do something like MyArray_as_mapping.length = > array_as_mapping.length but I don't know how to import array_as_mapping.
Maybe you can leave them NULL? I don't remember if they are inherited. > I also tried to do > MyArray_as_mapping.length = &PyArray_Type->tp_as_mapping->length but it > doesn't work... And that's where I'm stuck... How it fails? Note that you probably need to call import_array() first before assigning the function pointers. Pauli _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion