segfault in extension module

John J. Lee jjl at pobox.com
Mon Dec 1 15:34:17 CET 2003


Nathaniel Echols <echols at OCF.Berkeley.EDU> writes:
[...]
> > IMO just avoid all this stuff and use SWIG/Boost.Python/Pyrex.
> 
> I'll look at these, but I only have a tiny little bit of code I need to do
[...]
> Would I really benefit from using one of the other methods?

Why not take advantage of it?  You've already discovered how
hand-writing extensions can be painful.  SWIG is probably best for
you.  Ignore all the fancy SWIG features, just ask it to wrap the
function, it's very easy.


> The goal here
> is explicitly to put only the very time-dependent code in C; everything
> else stays in Python.

SWIG should be able to do that.  There's probably some overhead above
a hand-written wrapper, but it's so trivial to use SWIG in this simple
way that you probably shouldn't begin to worry about that -- it's
unlikely to be a problem.


John




More information about the Python-list mailing list