On Sat, Feb 26, 2011 at 10:15:38AM -0800, Robert Bradshaw wrote: > On Sat, Feb 26, 2011 at 5:08 AM, W. Trevor King <[email protected]> wrote: > > The relevant lines from tests/errors/cdef_members_T517.pxd are: > > > > $ grep -n ^ tests/errors/cdef_members_T517.pyx > > ... > > 8:ctypedef struct Foo: > > 9: int i > > 10: > > 11:cdef class Bar: > > 12: cdef Foo foo0 > > 13: cdef readonly Foo foo2 > > 14: cdef public Foo foo1 > > 15: pass > > ... > > ... > > What's less clear is the behavior of > > b = Bar() > b.foo1 = Foo(i=1) > b.foo1.i = 100 > print b.foo1 > saved = b.foo1 > del b > print saved
Is the problem choosing between: 1) Copy struct data into its own PyObject and let Python manage the memory. 2) Pass around a pointer to Cython-managed struct data. I suppose I don't really know enough about how Cython handles this yet to really see the problem or be able to help with a solution ;). -- This email may be signed or encrypted with GPG (http://www.gnupg.org). The GPG signature (if present) will be attached as 'signature.asc'. For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy My public key is at http://www.physics.drexel.edu/~wking/pubkey.txt
pgpPEITgq5Y4p.pgp
Description: PGP signature
_______________________________________________ cython-devel mailing list [email protected] http://mail.python.org/mailman/listinfo/cython-devel
