I'm having trouble experimenting with links in Cython. I use this code to create an int and reference to it.
cdef int i = 10;
cdef int& integer_ref = i;
However, I cannot figure out how to change the value I am through integer_ref. In C, I would just use integer_ref = some_other_value, and that would set the value ito some_other_value.
However, doing this in cython returns an error since link assignment is not allowed. I also tried integer_ref[0] = some_other_value, but tried to index int &, which is not allowed. What should i use? I found this post in a list of cython users , which apparently means this is a known bug, but I'm not too sure. The workaround in using link (&integer_ref)[0] = some_other_valuealso didn't work for me.
Thank!
source
share