Re: [capi-sig] Modify tp_getset or PyGetSetDef entries in run-time

July 6, 2012
12:35 p.m.
While this isnt impossible - its definetly not intended, when python runs PyType_Ready() it converts the PyGetSetDef's into PyObject's attribute descriptors which are stored in the PyType's dictionary. so strongly advice against trying to manipulate that data at low level... some alternatives could be....
- define pygetattro and manage the lookups on each call - typical way to handle such cases.
- you could look at assigning properties to a class as can be done in python...
MyClass.foo = property(getx, setx, delx, "This is a property")
... doing in C will be more verbose of course but it should work fine.
On Thu, Jul 5, 2012 at 1:42 PM, Mateusz Loskot <mateusz@loskot.net> wrote:
--
- Campbell
4634
Age (days ago)
4634
Last active (days ago)
0 comments
1 participants
participants (1)
-
Campbell Barton