Dynamically add members to a object at runtime
Hello Gang, I have come across the need to dynamically add members to an object at runtime. I would like to attach many objects of a single separate type into a object for processing. Is there a way to dynamically create object members while maintaining the (de)allocation structure? It would be nice to create an array of objects in a single PyObject but then a Py_DECREF() would not work on all of the objects in the array. Has anyone come across the need for this? It would make the module I am creating very easy to use. If not, a short "no" will not hurt my feelings ,')
E.g. w = DateTime() x = DateTime() my_object.add(w) my_object.add(x)
And then have some internal stuff possess those objects, E.g. my_object.combine_dates()
-- Bust0ut, Surgemcgee: Systems Engineer --- surgemcgee.com Django_Teamplate3d
participants (1)
-
Robert Steckroth