On Fri, Jul 18, 2014 at 12:44 PM, Robert Bradshaw <rober...@gmail.com> wrote: > On Fri, Jul 18, 2014 at 12:08 PM, Kurt Smith <kwmsm...@gmail.com> wrote: >> On Wed, Jul 16, 2014 at 1:02 PM, Robert Bradshaw <rober...@gmail.com> wrote: >>> >>> >>> Yes, this'd be nice to have. One difficulty with arrays is that they >>> can't be returned by value, and so the ordinary from_py_function >>> mechanism (which gets called recursively) would need to be adapted. >>> (Allowing to_py_function to be optinally be called by reference >>> instead of by value could be nice as well from a performance >>> standpoint.) >> >> >> OK, thanks for the pointers. I'll put some time on this over the weekend. >> Should I just make a PR when things are ready to review, or should I put up >> an issue first? > > I think this thread is sufficient; looking forward to a pull request.
Don't know if you had time to look at this yet, but another possible hack would be to use the fact that struct { int x[N]; } is bit compatible with int[N] and can be passed/assigned by value. E.g. struct wrapped_array { int x[3]; }; int main(int argc, char** argv) { int src[3]; int dest[3]; *((struct wrapped_array *) &dest) = *((struct wrapped_array *) &src); } OTOH, it might make sense to simply add array members as a special case in struct conversion. - Robert _______________________________________________ cython-devel mailing list cython-devel@python.org https://mail.python.org/mailman/listinfo/cython-devel