create a class instance from C API?

lallous lallous at lgwm.org
Mon Sep 28 11:19:40 EDT 2009


Hello

How to programmatically create a class instance of a given Python class?

For example to create a new list there is the PyObject *PyList_New() but 
suppose the user already defined a class:

class X: pass

How to create an instance of it from my C extension module?

Regards,
Elias 




More information about the Python-list mailing list