[C++-sig] Re: Boost.Python scope

Stefan Seefeld seefeld at sympatico.ca
Fri Nov 7 19:56:11 CET 2003


Nicolas Fleury wrote:

> If I undertand correctly, the way of doing it is something like:
> 
> handle<> main_module(borrowed( PyImport_AddModule("__main__") ));
> main_namespace dict(handle<>(borrowed(
>    PyModule_GetDict(main_module.get()) )));
> object result(handle<>(
>    PyRun_String("import pickle; pickle.load(open('myfile'))",
>                 Py_eval_input, main_namespace.ptr(),
>                 main_namespace.ptr())))
> 
> This is very nice, since I have a way of working with a 
> boost::python::object.  However, my question remain, should Boost.Python 
> scope/goal be enlarged to have no need for Py... C functions, providing 
> a full C++ API for Python/C++ interaction?

Beside their names all starting with 'Py' instead of 'boost::python::',
what would be different in a C++ API for these remaining functions ?
There is no automatic error / exception handling or ref counting that
you could possibly gain...

Or may be it's me who is missing something...

Regards,
		Stefan





More information about the Cplusplus-sig mailing list