[C++-sig] Embedded Python: how to enumerate function names?

David Abrahams dave at boost-consulting.com
Sun Aug 21 17:20:06 CEST 2005


"Bob Eaton" <bob_barb_eaton at yahoo.com> writes:

> In my embedded Python C++ code, I have a PyObject* to the module and its 
> dictionary. From either of these, is there a way to enumerate the 
> methods/functions defined in that file?
>
> I know I can at least get the function names with (((PyFunctionObject 
> *)func) -> func_name), but I'm not clear on how to get the PyFunctionObject 
> pointer to begin with. Is it the Keys or Values or Items of the dictionary?
>
> Also, once I have the function pointer, can I enumerate its parameters and 
> return type?
>
> And finally, what's the difference between a Function and a Method?
>
> Any help will be greatly appreciated.

This is not really a C++ specific question.  I don't mind you asking
here, but you will probably get better answers on the regular
python-list.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com




More information about the Cplusplus-sig mailing list