PyCon 2007 Live Blog: Swig Talk
Presented by Monty Taylor of MySQL.
Comparing other solutions, he only really talked about Boost.python. He doesn't like the huge ugly error messages.
Swig, he claims, is no longer slow, hard, or just for perl. It does make a lot of code, which can be interesting to look at.
%module simple
%include "simple.h"
%{
#include "simple.h"
%}
setuptools is Swig aware. That's kind of cool.
C Sucks.
...because of error checking requirements. Maybe so,
but it doesn't become less complicated at the boundaries between C++ and
python. Swig doen't make things easier here.
Swig allows extension of classes (monkeypatching
).
class C {
public:
class Inner {};
};
Cons: Swig doesn't handle inner classes at all. Overloaded methods are pretty awkward, going from Python back to C++.
typemaps
: powerful; need their own talk.
Ran into Shane Geiger. I guess he's living in Austin now.
Swig docs swig python very complete.
Comments: 0