And so I remember next time (Should have thought of it earlier, but the sketch said to go the other way...)
Written by
on
in
Snaking.
Oh, I figured out a simpler way to handle the numeric api module overriding of the base module's functions. Since the functions have identical signatures, I can just have the numeric module's initialiser load the base module and change the vtable using the base module's defined names for each function, i.e:
pyopenglbaseapi[ PyObject_FromDoubleArray_NUM ] = (void *)NumericPyObject_FromDoubleArray;
Should solve the entire problem (since the base code then doesn't need to muck about with having two different APIs depending on whether the Numeric module is the one using it). It's somewhat inelegant to have the one module mucking about with the other's vtable, but it does seem like it's the best approach. This way the numeric module only needs to know about the functions it overrides, there's no need to have it forwarding everything from the base module to its clients.
Pingbacks
Pingbacks are closed.
Comments
Comments are closed.