for example if I have something like this:

cimport numpy as np

cdef void foo(np.ndarray arr):
            <do stuff>


def bar(np.ndarray arr):
       foo(arr)


is arr getting passed by value or by reference?

When I wrap other C libraries, I have to do a  foo(&cobject)  to pass
cobject by reference and have foo defined as:

cdef foo(somectype* cobject):
        cobject.intvalue = 3


The reason I ask is because even though i'm not explicity passing the
numpy arrays by reference, I can still access the struct memember via
dotted notation (arr.strides[2] for example). Since Cython doesnt have
a -> operator, its not exactly clear what is going on here in this
situation.

Cheers!

Chris
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to