Showing content from http://mail.python.org/pipermail/python-dev/attachments/20060531/db6f3342/attachment-0001.c below:
#include "Python.h" typedef struct { PyObject_HEAD double real; double imag; } PyNewComplexObject; static PyTypeObject PyComplex_SubType = { PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ "newcomplex", /*tp_name*/ sizeof(PyNewComplexObject), /*tp_basicsize*/ }; static PyObject * _complex_alloc(PyTypeObject *type, int nitems) { PyObject *obj; obj = (PyObject *)malloc(_PyObject_SIZE(type)); memset(obj, 0, _PyObject_SIZE(type)); PyObject_INIT(obj, type); return obj; } PyMODINIT_FUNC initbugtest(void) { PyObject *m, *d; m = Py_InitModule("bugtest", NULL); d = PyModule_GetDict(m); PyComplex_SubType.tp_free = free; PyComplex_SubType.tp_alloc = _complex_alloc; PyComplex_SubType.tp_base = &PyComplex_Type; PyComplex_SubType.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_CHECKTYPES; PyType_Ready(&PyComplex_SubType); Py_INCREF(&PyComplex_SubType); PyDict_SetItemString(d, "newcomplex", (PyObject *)&PyComplex_SubType); return; }
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