3

My code is:

cdef extern from "mylib.h":
    cdef cppclass MyClass:
        MyClass(const char *data) except +
        # and I also need except + for myMethod
        int myMethod(size_t len, char *data) const

I need both const and except + for my method, but I cannot. I tried to write it after space, after comma, put both declarations in parenthes -- but got different types of cyntax errors. Documentation gave no hints about multiple annotations...

cython 0.20.1 from Ubuntu Trusty was used.

monoid
  • 1,661
  • 11
  • 16

1 Answers1

4

For reference, the answer the OP seems to have got from the Cython mailing list was essentially that it is currently not possible, but that it might not matter in practice, since the const can be dropped in favour of the except + without affecting the ability to compile.

Dologan
  • 4,554
  • 2
  • 31
  • 33
  • But it does make a difference if you put the C++ part in a separate shared library, it seems. It then can't find the required symbol. – csl Mar 04 '17 at 23:06