so, here is my problem: I code in python, but I need to improve performance in some part of my code that are too slow. A good(and easy) solution seems to be using cython; I tried it and got good results. The issue is that I use assert statement in my python code. Before using cython, I could compile my python code with the -OO option, so that I can deliver a version not executing any assertion test, and still have the assert for debug. But the files that are compiled in cython seems to always execute the asserts. Is there some options that can be passed to cython compilation to remove(or not remove) the assertions?
Cython skips the assertions if you define the C preprocessor macro PYREX_WITHOUT_ASSERTIONS
. So pass -DPYREX_WITHOUT_ASSERTIONS
to the C compiler when compiling the generated C file. How to to this depends on your build process.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With