On Thu, 2014-03-13 at 16:57 +0100, Stefan Behnel wrote: […] > The thing is: if you have to write your own wrapper anyway (trivial or > not), then why not write it in Cython right away and avoid the intermediate > plain C level?
If the task is two write an adapter (aka wrapper) then perhaps use SWIG whcih is easier for this task than writing Cython code. > It's usually much nicer to work with object oriented code on both sides > (assuming you understand the languages on both sides), than to try to > squeeze them through a C-ish API bottleneck in the middle. It could be that "object oriented" is a red herring. Without details (*) of what it is about the C++ code that is the connection between Python and C++, it is difficult to generalize. ctypes can be a real pain when trying to call C++ from Python using argument values that are not primitive types. CFFI solves (currently much, soon most) of this problem by addressing the adapter between Python and C++ in a different way to that employed by ctypes. In both cases, both are a lot easier than writing Cython code. (*) I may have just missed this detail in which case apologies. -- Russel. ============================================================================= Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.win...@ekiga.net 41 Buckmaster Road m: +44 7770 465 077 xmpp: rus...@winder.org.uk London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
signature.asc
Description: This is a digitally signed message part
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor