[issue3208] function annotation for builtin and C function
Haoyu Bai
report at bugs.python.org
Wed Jul 23 19:35:01 CEST 2008
Haoyu Bai <divinekid at gmail.com> 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 <report at bugs.python.org>
<http://bugs.python.org/issue3208>
_______________________________________
More information about the Python-bugs-list
mailing list