Skip wrote: > When defining ExtensionClass types, you need to create and initialize a > PyExtensionClass struct. It looks something like so: > > PyExtensionClass PyGtkTreeSortable_Type = { > PyObject_HEAD_INIT(NULL) > 0, /* ob_size */ > "GtkTreeSortable", /* tp_name */ > sizeof(PyPureMixinObject), /* tp_basicsize */ > ... > }; > > Note that the parameter to the PyObject_HEAD_INIT macro is NULL. It would > normally be the address of a type object (e.g. &PyType_Type). However, Jim > Fulton pointed out that on Windows you can't get the address of &PyType_Type > object at compile time. Accordingly, ExtensionClass provides a > PyExtensionClass_Export macro whose responsibility is, in part, to set the > ob_type field appropriately at runtime footnote: this is usually done in the module init function, *before* the call to Py_InitModule. see: http://www.python.org/doc/FAQ.html#3.24 if the garbage collector can run after Python calls a module's init- function, but before that module calls back into Python, anything can happen... Cheers /F
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4