[Cython] Fwd: [cython-users] can pointers be stored in Python's dict or list?

2012-09-14 Thread Robert Bradshaw
Given the CObject vs Capsule differences in Py2 vs Py3, and the clumsiness in using them (see below), any thoughts on automatically converting void* to/from a Python object? There is the sticky issue of pointer lifetime management, but we could assume the lifetime is managed entirely in C in most c

Re: [Cython] Fwd: [cython-users] can pointers be stored in Python's dict or list?

2012-09-14 Thread Dag Sverre Seljebotn
Isn't there a case for converting to/from ctypes pointers rather than capsules? And if capsules, what would the secret word be? Hmm... (sorry for the top post) DS -- Sent from my Android phone with K-9 Mail. Please excuse my brevity. Robert Bradshaw wrote: Given the CObject vs Capsule differ

Re: [Cython] Fwd: [cython-users] can pointers be stored in Python's dict or list?

2012-09-14 Thread Robert Bradshaw
On Fri, Sep 14, 2012 at 2:29 PM, Dag Sverre Seljebotn wrote: > Isn't there a case for converting to/from ctypes pointers rather than > capsules? And if capsules, what would the secret word be? Hmm... +1, ctypes would be even better. It's not in the standard library 'till 2.5, but I don't think th

Re: [Cython] Fwd: [cython-users] can pointers be stored in Python's dict or list?

2012-09-14 Thread Stefan Behnel
Robert Bradshaw, 15.09.2012 00:39: > On Fri, Sep 14, 2012 at 2:29 PM, Dag Sverre Seljebotn wrote: >> Isn't there a case for converting to/from ctypes pointers rather than >> capsules? And if capsules, what would the secret word be? Hmm... > > +1, ctypes would be even better. It's not in the standa