[capi-sig] PyFunction_New examples
ideasman42 at gmail.com
Tue Apr 7 04:20:48 CEST 2009
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
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 <trigves at yahoo.com> wrote:
> 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
> capi-sig at python.org
More information about the capi-sig