j: Next unread message
k: Previous unread message
j a: Jump to all threads
j l: Jump to MailingList overview
Hi there, I never used PyFunction_New() If you can make the code object on the fly this should be no problem.
I have only used PyCFunction_New(), you can set "self" to be any PyObject you like (or a tuple of them) Then your C function will get self as an argument, which can be different for every instance of your PyCFunction and decide what to do based on that.
The main problem with PyCFunction_New is that your tied to predefined C functions.
Another option is to define your own callable PyType.
Sorry I didn't really answer your question but maybe this helps still.
On Mon, Apr 6, 2009 at 8:58 AM, Trigve Siver firstname.lastname@example.org wrote: >
Hi, I'm trying to use PyFunction_New() function but I've problem finding out how it works. What I'm trying to do is to create python function on the fly and then trying to create function object from if via PyFunction_New.
My problems are similar to this:
Please CC me.
capi-sig mailing list email@example.com http://mail.python.org/mailman/listinfo/capi-sig