[C++-sig] Boost.Python scope

Nicodemus nicodemus at esss.com.br
Sun Nov 9 19:45:50 CET 2003


Nicolas Fleury wrote:

> Hi,
> If I understand correctly (correct me if I'm wrong), the Boost.Python 
> library purpose is mainly only to expose C++ in Python.  It doesn't 
> provide the equivalent of the C API and I wonder if it should be 
> changed.  I prefer to work with boost::python::objects than with 
> PyObjects and I prefer C++ to C.  Right now, I have to use the C API 
> to do certain things (like read a pickled object in C++).  Do you 
> think the current Boost.Python scope should be enlarged to provide a 
> complete C++ API?  Or at least add a function to execute python code 
> and store the result in a boost::python::object? 


I think that a good part of what you may want is already there, for 
instance, we have wrappers for python lists, tuples, dicts, etc, but the 
entire Python C API is not exposed. I think an effort to expose a larger 
part of it would be great, but I guess that Dave doesn't have time to do 
it, so the work must be done by volunteers.
There's been some discussion in the past to write an wrapper for the 
interpreter part of the C API in C++ (allowing you to run python code 
through the it instead of using PyRun_String for instance) but the 
discussion died without generating anything useful. 8/





More information about the Cplusplus-sig mailing list