I know that the "object/method calling API" is an open question but in the
meantime is there any reliable (but maybe ugly) way for me to call an
HPyDef_METH in a "Universal" (non-CPython) context?
I'm looking for something like this:
extern int PyWasm_Call_PyMethod(void *meth_handle, void *args, void
*kwargs){
HPyMeth *method = (HPyMeth *)meth_handle;
PyWasmDebug("Calling func %s with %p and %p ", method->name, args,
kwargs);
HPy rc = method->impl(args, kwargs)
}
It's unclear to me whether the thing in HPyMeth->impl has a uniform calling
convention or the heterogeneous one exposed by the objects themselves.
For example:
static HPy do_nothing_impl(HPyContext ctx, HPy self)
Versus
static HPy add_ints_impl(HPyContext ctx, HPy self, HPy *args, HPy_ssize_t
nargs)
Do I have to look at the signature and call each one with the "right"
calling convention?
Or is there a particular CPython library that I could pull in to do the
calling without pulling in the whole interpreter (which would defeat the
purpose of HPy!)?
Paul