python Programming Glossary: pyobject_head
How to create a generator/iterator with the Python C API? http://stackoverflow.com/questions/1815812/how-to-create-a-generator-iterator-with-the-python-c-api Define a new object class Sequence. typedef struct PyObject_HEAD size_t max SequenceObject Instance variables static PyMemberDef.. Sentinel Define new object type PyTypeObject Sequence_Type PyObject_HEAD_INIT NULL 0 ob_size Sequence tp_name sizeof SequenceObject.. ob_type tp_free PyObject self PyTypeObject Generator_Type PyObject_HEAD_INIT NULL 0 ob_size Generator tp_name sizeof GeneratorObject..
How do you extend python with C++? http://stackoverflow.com/questions/2847617/how-do-you-extend-python-with-c #include Flp.h static PyObject ErrorObject typedef struct PyObject_HEAD PyObject x_attr attributes dictionary FlpObject static void.. init function to be portable to Windows without using C . PyObject_HEAD_INIT NULL 0 ob_size Flp tp_name sizeof FlpObject tp_basicsize.. #include Flp.h static PyObject ErrorObject typedef struct PyObject_HEAD PyObject x_attr attributes dictionary FlpObject extern C static..
Accessing the underlying struct of a PyObject http://stackoverflow.com/questions/3436730/accessing-the-underlying-struct-of-a-pyobject typedef struct int x int y Point typedef struct PyObject_HEAD Point my_point PointObject static PyTypeObject PointType PyObject_HEAD_INIT.. Point my_point PointObject static PyTypeObject PointType PyObject_HEAD_INIT NULL 0 ob_size point tp_name sizeof PointObject tp_basicsize..
Py_INCREF/DECREF: When http://stackoverflow.com/questions/4657764/py-incref-decref-when 'C type as an attribute' I mean bar and baz typedef struct PyObject_HEAD PyObject foo int bar double baz FooBarBaz python python c api..
Error with Python ctypes and librsvg http://stackoverflow.com/questions/6142757/error-with-python-ctypes-and-librsvg I'm getting a segfault. C pycairo excerpt typedef struct PyObject_HEAD cairo_t ctx PyObject base base object used to create context.. 'ex' c_double class PycairoContext Structure _fields_ 'PyObject_HEAD' c_byte object.__basicsize__ 'ctx' c_void_p 'base' c_void_p..
|