create a class instance from C API?

lallous lallous at
Mon Sep 28 17:19:40 CEST 2009


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?


More information about the Python-list mailing list