4 Sep
2007
4 Sep
'07
1:19 p.m.
Campbell Barton cbarton@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.