CGContextRef is a pointer. sizeof(CGContextRef)==4. Steve Chaplin wrote: > CGContextRef may be a problem. If its really a C type (like an int), > then pycairo bindings can be written for this function. But if its some > custom type then there would need to be existing python bindings for it > with a C API that pycairo can use in order to access the CGContextRef.