Thursday, July 15, 2010

RPy2 and PyCapsules

PyCapsules were one of the new features in Python 3 from which RPy2 was supposed to benefit. But it seems that they don't do exactly what I thought they do. They're a way of wrapping functions rather than objects so that they can be accessed by other modules. More specifically, it's supposed to be a portable (i. e. independent of symbol visibility between shared libraries) way of exposing C API to other C modules.
RPy2 doesn't expose any custom APIs to other modules, so there's seemingly no use for PyCapsules. Thus, Laurent (my mentor) and I decided not to include this feature in the project.

PyCapsules are described in section 1.12 of Extending Python:
http://docs.python.org/py3k/extending/extending.html#providing-a-c-api-for-an-extension-module
(in hindsight even the title is a bit of a giveaway: "Providing a C API for an Extension Module").

No comments:

Post a Comment