Easier to wrap C or C++ libraries?

Daniel Fetchinson fetchinson at googlemail.com
Fri Feb 13 21:28:22 EST 2009


> When creating a Python binding to a C or C++ library, which is easier
> to wrap, the C lib or the C++ one? Given a choice, if you had to
> choose between using one of two libs, one written in C, the other in C+
> + -- both having approximately the same functionality -- which would
> you rather deal with from your Python code?
>
> It would seem to me that there's fewer design considerations when
> wrapping a library written in C; you just wrap the functions. However,
> since Python supports OOP nicely, it might also be that wrapping C++
> code *could* also be staightforward... Are there many pitfalls when
> having to map C++'s notion of OO to Python?

There is no question about it in my mind that wrapping C is easier.
Reason being that python is written in C and not C++.

Cheers,
Daniel

-- 
Psss, psss, put it down! - http://www.cafepress.com/putitdown



More information about the Python-list mailing list