Defining Python class methods in C

Bryan belred1 at yahoo.com
Sat Mar 22 20:59:53 EST 2003


it looks like self in context_init is also NULL.  i thought that at
__init__ time, you already have a self variable.

in python in nutshell, page 544, initpair is calling these two
methods:

PyType_Ready(&t_intpair);
PyObject_SetAttrString(this_module, "intpair", (PyObject*)&t_intpair);

i tried something similiar, but self in both of my methods is NULL.

bryan




More information about the Python-list mailing list