I'm using the Python C API to call Python functions from my application. I'd like to present a list of functions that could be called and would like to be able to limit this list to just the ones with the expected number of parameters.
I'm happy that I can walk the dictionary to extract a list of functions and use PyCallable_Check
to find out if they're callable, but I'm not sure how I can find out how many parameters each function is expecting?
I've found one technique involving Boost::Python, but would rather not add that for what (I hope!) will be a minor addition.
Thanks :)