[C++-sig] A few questions on Boost.Python

Bo Jensen jensen.bo at gmail.com
Mon Jan 23 20:35:15 CET 2012


Hi,

I have been looking into the best way for me to make a python wrapper for a
C++ library. Boost.Python looks nice and seem to fit my needs, but I have a
few questions before I dig in deep and do the implementation.

What I want to do :

I have a very thin header only C++ library, which is an extension on top of
a c library i.e some of the C++ functions call functions in a C dll/so. So
the C++ library only provides a nice way of using the C library with
operators and overloading etc. For this library I want to make an python
interface, which only should mimic the C++ classes and functions i.e there
will be a 1:1 mapping.

Questions :

1) Would Boost.Python be suited for such a task ?

2) What kind of speed can I expect ? I read somewhere that cython was much
faster (but it seems to be less portable and flexible).

3) Will I experience problems with types like wchar or long long ?

4) How do I link to my C library ?

5) I also read that Boost.Python is not thread safe, is that true and if
yes can it be fixed/hacked ?

6) Regarding portability, will I have to recompile for each python version ?

7) 64 bit is supported right ?

Thanks to anybody providing some insight.

/Bo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/cplusplus-sig/attachments/20120123/fe5aeafe/attachment.html>


More information about the Cplusplus-sig mailing list