[Pyobjc-dev] Handling (void *)
Brought to you by:
ronaldoussoren
From: <bb...@ma...> - 2002-11-07 16:15:05
|
That seems like about as close to a workable set of behaviors as we can get without special casing certain methods. For contexts that use a (void *) as a bit of userInfo, we simply need to make sure that a Python object passed in can be recovered during the call back. This will likely require a treat-that-void-thing-as-a-python-object-reference and also raises the what-if-it-should-really-be-an-NSObject specter. b.bum On Wednesday, November 6, 2002, at 06:26 AM, Jack Jansen wrote: > What I tend to do if I run into this situation when wrapping an API is > the following: > - If the Python object is None I pass NULL, else > - If the Python object conforms to the buffer protocol we use > bf_getreadbuffer() or bf_getwritebuffer(), else > - if it's a PyCObject we use PyCObject_AsVoidPtr(). |