Exporting a Class from a .pyd

Courageous jkraska1 at san.rr.com
Thu Jul 5 21:00:13 EDT 2001

On Thu, 05 Jul 2001 14:12:06 GMT, gerson.kurz at t-online.de (Gerson Kurz) wrote:

>It is quite easy to export methods, and constants, and even datatypes
>from a .pyd (Python Extension DLL, .so in #?nix). However, how do you
>export a class ? Is it just a special way of exporting datatypes ?
>(But then, I cannot yet see how to add methods to such a datatype).
>I've looked up google but in vain.

In Unix .so shared libraries, exporting happens automatically. In Windows
DLLs, you do it explicitly, like this:

class __declspecl(dllexport) [classname]

This also automatically exports all class methods. Note, however, that
static class data isn't properly exported.


More information about the Python-list mailing list