Re: [C++-sig] Returning values to Python in C++ reference arguments

2015-05-26 Thread Holger Joukl
Hi, > Von: Jason Addison > You can return results via function arguments from C to Python (see > code below). > > Why is something similar impossible with Boost Python? > > my_module2.c > > /* > clang -c -I/usr/include/python2.7 my_module2.c > clang -dynamiclib -o my_module2.so -lpython2.7 my

Re: [C++-sig] Returning values to Python in C++ reference arguments

2015-05-26 Thread Jason Addison
On Mon, May 25, 2015 at 3:39 AM, Trigve Siver via Cplusplus-sig wrote: > > >> >> How can results be returned in function arguments? >> > > > I don't think that you can return arguments by reference/pointers in python. > You could theoretically pass a mutable sequence (list) and push the objects

Re: [C++-sig] Returning values to Python in C++ reference arguments

2015-05-26 Thread Holger Joukl
> Von: Jason Addison > > How can results be returned in function arguments? > > I've include my example C++ extension and Python code below. > > I've tried, what I think, are some obvious approaches (Python objects, > ctypes), though none have worked. > > It seems like this should be doable. As a