[C++-SIG] Python classes with methods that are C extensions?

Jonathan Greene jgreene at adaptivesilicon.com
Sat Sep 23 22:31:10 CEST 2000

I know one can extend Python with C functions in two ways:
1. Modules with functions that are C functions.
2. Extension types with methods that are C functions

Is there also a way to have true Python classes (not types) whose
methods are C functions? I've heard rumors that  there have been changes
to Python since 1.5.1 that make this possible but have seen nothing in
the documentation.

Note: It is possible to write a class method in Python that calls a C
function (as SWIG does). But I would like to avoid this approach since
it involves a 2nd function call and thus worse performance.

More information about the Cplusplus-sig mailing list