[Pyrex] How to deal with a void *

Greg Ewing greg.ewing at canterbury.ac.nz
Fri May 12 04:58:57 CEST 2006


Tomasz Primke wrote:

> Have you tried:
> 
>    cdef void *foo
>    cdef unsigned long int *bar
> 
>    foo = initResource()
>    bar = <unsigned long int*> foo

I don't think that will help the OP, because it
sounded like he wanted to be able to pass his
void * through Python code.

The only two safe ways of doing that have already
been suggested: wrap it in an extension type, or
wrap it in a PyCObject.

-- 
Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | Carpe post meridiem!          	  |
Christchurch, New Zealand	   | (I'm not a morning person.)          |
greg.ewing at canterbury.ac.nz	   +--------------------------------------+



More information about the Pyrex mailing list