As an extension writer, this bugs me [1]. Looking into Python's sources, I find mostly code like this: static PyObject * func_get_code(PyFunctionObject *op) { .... } static PyGetSetDef func_getsetlist[] = { {"func_code", (getter)func_get_code, (setter)func_set_code}, .... {NULL} /* Sentinel */ }; in other words, casting like hell to the correct function type. Should a style like this should be preferred: static PyObject * func_get_code(PyObject *py) { PyFunctionObject *op = (PyFunctionObject *)py; .... } static PyGetSetDef func_getsetlist[] = { {"func_code", func_get_code, func_set_code}, .... {NULL} /* Sentinel */ }; in other words, move the cast where you are more sure about it's correctness, and give the compiler a change for meaningfull warnings. Thomas [1] Actually it's getting better since the documentation has improved a lot, before that I was mainly looking into the source or for examples.
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