7 Apr 2010 19:36
Re: C++ Wrapper Confusion
Robert Bradshaw <robertwb <at> math.washington.edu>
2010-04-07 17:36:36 GMT
2010-04-07 17:36:36 GMT
On Apr 7, 2010, at 10:06 AM, SevenThunders wrote: > I am trying to wrap an existing C++ class in cython. I've had some > success in the past wrapping a C library, however I find the state of > the C++ documentation rather confusing. I believe there have been > some prior posts on this issue. My first question is what wrapping > syntax is actually suported in Cython 0.12.1? The online > documentation for version 0.12 has the 'older' syntax here, > http://docs.cython.org/src/userguide/wrapping_CPlusPlus.html . > > Some earlier posts suggest that this is deprecated and that we should > use the rather terse discussion here: > http://wiki.cython.org/WrappingCPlusPlus The new syntax is not available in Cython 0.12.1, but will be in Cython 0.13 which should be out soon (yes, soon has dragged on for a month or two more than we would have liked, but I think the issues uncovered by Sage have been resolved (Craig?) and as has been discussed, if we need to postpone closures due to a refcounting bug, so be it). > Although the effort to provide C++ support is greatly appreciated, > there are a few things missing from this documentation. Though it has been getting better, there is still *lot* of things missing from this documentation. > There is no discussion about how to define the extension class See http://docs.cython.org/src/tutorial/cdef_classes.html(Continue reading)
diff -r b442fb71c1de Cython/Compiler/ExprNodes.py
--- a/Cython/Compiler/ExprNodes.py Sat Mar 20 18:07:43 2010 +0100
+++ b/Cython/Compiler/ExprNodes.py Fri Apr 09 22:55:08 2010 -0300
<at> <at> -6287,14 +6287,14 <at> <at>
""",
impl = """
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) {
- PyObject *__import__ = 0;
+ PyObject *py__import__ = 0;
PyObject *empty_list = 0;
PyObject *module = 0;
PyObject *global_dict = 0;
PyObject *empty_dict = 0;
RSS Feed