[capi-sig] Assigning values to functions from C
Hrvoje Niksic
hniksic at xemacs.org
Tue Sep 4 09:49:53 CEST 2007
Campbell Barton <cbarton at metavr.com> writes:
> Iv looked a fair bit in python source code and cant see how this is
> possible...
The thing is, a Python-defined function isn't stored in a PyCFunction,
it's stored in the PyFunction object, which includes a func_dict
member.
I'm afraid you won't be able to easily assign values to a PyCFunction.
You can try to inherit PyCFunction and add a dict to it, or you can
create your own callable type that has a dict.
More information about the capi-sig
mailing list