[Cython] setting C++ mode in cythonize()

Stefan Behnel stefan_ml at behnel.de
Fri Oct 3 09:27:48 CEST 2014


Hi,

the documentation suggests to pass language='c++' into cythonize() to
globally enable C++ mode, but AFAICT, this never actually worked. Cython
previously ignored this option, Cython 0.21 rejects it, and we didn't
update the docs, so the current situation is outright confusing.

http://docs.cython.org/src/userguide/wrapping_CPlusPlus.html#specify-c-language-in-setup-py

To me, this option seems the one obvious way to do it, as it mimics the
distutils Extension API most closely. So, I now implemented support for
this, but only for modules found by file name, not for user provided
Extension objects. I think that's a reasonable restriction. If users
construct their own Extension instances anyway, they can just as well set
the 'language' option on them directly (and probably already do so).

https://github.com/cython/cython/commit/88df97f250073d8a06f965d6a7e09d8fe6f4ca63

Stefan


More information about the cython-devel mailing list