Christian Tismer <tismer@tismer.com> writes: > The problem is that I need to give extra semantics to existing > objects, which are PyCFunction objects. I think putting an extra > bit into the type object doesn't help, unless I use a new type. But > then I don't need the flag. An old extension module which is loaded > into my Python will always use my PyCFunction, since this is always > borrowed. I understand the concern is not about changing PyCFunction, but about changing PyMethodDef, which would get another field. I think you can avoid adding a field to PyMethodDef, by providing a PyMethodDefEx structure, which has the extra field, and is referred-to from (a new slot in) the type object. The slots in the type object that refer to PyMethodDefs would either get set to NULL, or initialized with a copy of the PyMethodDefEx with the extra field removed. Regards, Martin
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