On May 12, 2009, at 1:36 PM, Chris Swierczewski wrote:

>> No you can't, the signatures are incompatible at the C level.
>
> Drat.
>
>> The question is: if the method makes sense without the class, why  
>> is it a
>> method in the first place? Maybe you should make it a function and  
>> just
>> call it from the class method?
>
> Thanks for bringing that to mind. I guess I should share that
> possibility with the other developers for the project I'm working on.
> We thought of encapsulating some of the functionality in a class just
> for organizational purposes but perhaps bumping it up to module-level
> would be better.


You can make a callback functions like

cdef my_callback(double x, void* params):
     (<MyClassObject>params).callback_method(x)

if the overhead isn't too great.

- Robert

_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to