2011/6/30 Stefan Behnel <stefan...@behnel.de>: >> If there are too many hoops to jump through to get a reasonable >> solution working for 2.[567], I might as well go back to >> Py_InitModule() and static variables. It's somewhat ugly, but it >> works. > > Py2.x has a PyCObject, basically the predecessor to PyCapsule. Writing your > own little type is another option.
For reference: PyCObject has PyCObject_FromVoidPtr() and PyCObject_AsVoidPtr() -- exactly what I was looking for (no idea why I missed it for so long?!). Ok, and it also has the note: "The CObject API is deprecated as of Python 2.7. Please switch to the new Capsules API." which is of no concern here :) Thanks heaps! Daniel -- http://mail.python.org/mailman/listinfo/python-list