Lisandro Dalcin wrote: > Note however that in my own code I use this: > > cdef extern from "Python.h": > ctypedef struct PyObject > > > In general, typedef'ing things to void* is a really bad idea, I always > try hard to avoid it. See the code below, Cython will (correctly) not > complain
I backtracked on this now (as that declaration was used in testcases as well). You can now do <MyStruct*>obj and <AnyVoidType*>obj, but not <double*>obj or <int*>obj. Slightly better, though long-term I'd prefer a canonical builtin PyObject and only allow it for that one. (In python_ref.pxd the contents of PyObject is available as well, and there's not really a way to seperate it from other structs unless we ... chech the name *shudder*). -- Dag Sverre _______________________________________________ Cython-dev mailing list [email protected] http://codespeak.net/mailman/listinfo/cython-dev
