Haoyu Bai <[EMAIL PROTECTED]> added the comment: I think there is reason that CFunctionObjects are immutable: single CFunctionObject is shared by mutiple Python interpreters, so any change of CFunctionObject would affect other Python interpreters. Is that right?
If it should be immutable, then we should use something like static array to assign annotations to CFunctionObject, and the value also should be immutable, that means the value couldn't be abitrary PyObject. (by value I mean the value of every __annotations__ dict items.) For SWIG, there's a way to bypass the Python side proxy, eg. for a simple C function, in the shadow module we directly let 'func=_cmod.func', where _cmod is the C DLL module. So the annotation information would be lost if we can't directly assign annotation to C function. _______________________________________ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3208> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com