[Pyrex] Tricky: Wrapping a (void *) cookie

Greg Ewing greg at cosc.canterbury.ac.nz
Mon May 5 05:56:43 CEST 2003


jkoshy at FreeBSD.ORG (Joseph Koshy):

>      # Try 1
>      # the following won't work
>      f = Foo()
>      f.foo = v           # Error: Cannot convert 'void (*)' to Python object

It should work if you add a declaration for f:

  cdef Foo f # <--- add this!
  f = Foo()
  f.foo = v

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg at cosc.canterbury.ac.nz	   +--------------------------------------+




More information about the Pyrex mailing list