[C++-sig] choosing a python-c++ interface: a few questions

David Abrahams david.abrahams at rcn.com
Tue Jul 9 01:43:06 CEST 2002


----- Original Message -----
From: "David Marimont" <marimont at nxpdata.com>

> 1. Are interfaces to the C++ standard library are part of the existing
> Boost Python Library?

Not directly. Remember, the parts of the C++ standard library you're
speaking of are mostly class and function /templates/, not actual classes
and functions. You can only bind actual classes and functions to Python
i.e. a particular instantiation of a class or function template. Lots of
people have done that successfully, though.

> 2. Can interfaces be generated automatically from C++ source code?

Not with Boost.Python. It is a feature of Boost.Python that it uses the C++
compiler to do its work rather than attempting to parse and understand your
C++ source. All systems which try to do that eventually break down, because
the source code doesn't contain enough information to do the whole job. At
that point, you end up having to modify the generated interface
descriptions or hand-wrap code. Of course, such systems also have an
upside, which is often a lower barrier-to-entry.

> 3. If the answer to either of these questions is no, will that change
> in version 2?

Version 2 will have some direct support for passing Python sequences such
as lists and tuples to wrapped C++ functions which expect STL-style C++
sequences as parameters. This work has already been done by Ralf
Grosse-Kunstleve, and several people are currently using it.

We don't have plans to add automatic interface generation right away. I
think it would be a good feature to add eventually, but for now we're
trying to relieve most of the tedium of wrapping using just the C++
language.

> I've only been reading this list for a week or so now, so I'm not sure
> I'm addressing these questions to the right people.  Any help you
> could give me, including pointers to other places to get these
> questions answered, is much appreciated!

I hope this has been helpful,
Dave






More information about the Cplusplus-sig mailing list