Re: [Cython] [cython-users] Re: callback function pointer problem

2011-10-06 Thread Robert Bradshaw
On Wed, Oct 5, 2011 at 3:41 PM, Greg Ewing wrote: > Robert Bradshaw wrote: > >> On this note, eventually I would like coerce structs (and unions, >> enums) to auto-generated wrapper classes, visible in the Python module >> namespace if one declares them as "cpdef struct ..." > > Would these wrappe

Re: [Cython] [cython-users] Re: callback function pointer problem

2011-10-05 Thread Greg Ewing
Robert Bradshaw wrote: On this note, eventually I would like coerce structs (and unions, enums) to auto-generated wrapper classes, visible in the Python module namespace if one declares them as "cpdef struct ..." Would these wrapper classes contain a copy of the struct, or would they reference

Re: [Cython] [cython-users] Re: callback function pointer problem

2011-10-05 Thread Robert Bradshaw
On Fri, Sep 30, 2011 at 2:14 PM, Dag Sverre Seljebotn wrote: > Are you saying that when coercing a struct to an object, one would copy > scalar fields by value but reference array fields? -1, that would be > confusing. Either the whole struct through a view, or copy it all. +1 > It bothers me th

Re: [Cython] [cython-users] Re: callback function pointer problem

2011-09-30 Thread mark florisson
On 30 September 2011 22:42, mark florisson wrote: > On 30 September 2011 22:14, Dag Sverre Seljebotn > wrote: >> Are you saying that when coercing a struct to an object, one would copy >> scalar fields by value but reference array fields? -1, that would be >> confusing. Either the whole struct th

Re: [Cython] [cython-users] Re: callback function pointer problem

2011-09-30 Thread mark florisson
On 30 September 2011 21:50, Dag Sverre Seljebotn wrote: > Note: The last field in a C struct can be of variable size, decided at > malloc-time. I can't think of a clear syntax for that, except perhaps a > builtin function cython.coercevariablesizestruct... > > > > Dag Sverre > -- > Sent from my An

Re: [Cython] [cython-users] Re: callback function pointer problem

2011-09-30 Thread mark florisson
On 30 September 2011 22:14, Dag Sverre Seljebotn wrote: > Are you saying that when coercing a struct to an object, one would copy > scalar fields by value but reference array fields? -1, that would be > confusing. Either the whole struct through a view, or copy it all. Hmm, yeah it might be confu

Re: [Cython] [cython-users] Re: callback function pointer problem

2011-09-30 Thread Dag Sverre Seljebotn
Are you saying that when coercing a struct to an object, one would copy scalar fields by value but reference array fields? -1, that would be confusing. Either the whole struct through a view, or copy it all. It bothers me that structs are passed by value in Cython, but it seems impossible to ch

Re: [Cython] [cython-users] Re: callback function pointer problem

2011-09-30 Thread Dag Sverre Seljebotn
Note: The last field in a C struct can be of variable size, decided at malloc-time. I can't think of a clear syntax for that, except perhaps a builtin function cython.coercevariablesizestruct... Dag Sverre -- Sent from my Android phone with K-9 Mail. Please excuse my brevity. mark florisson

Re: [Cython] [cython-users] Re: callback function pointer problem

2011-09-30 Thread mark florisson
On 29 September 2011 22:48, Robert Bradshaw wrote: > On Thu, Sep 29, 2011 at 5:29 AM, mark florisson > wrote: >> On 29 September 2011 13:13, Miguel Angel wrote: Structs already coerce to python dicts. In the memoryview branch it also does the reverse, i.e. coerce a dict to a struc