On Thu, Aug 6, 2009 at 10:42 PM, Ed Leafe<[email protected]> wrote: > On Aug 6, 2009, at 1:44 PM, Paul McNett wrote: > >>> I have a list with a function's name and its >>> parameters...['func_name','param1','param2',...] >> >> Keep a list with the function's object reference, and tuples of args >> instead: > > > If you can't keep a function reference, and only have the name, if > that function is an instance method of object 'obj', you can invoke it > by the following: > > getattr(obj, 'func_name').(param1, param2) > > > -- Ed Leafe
Ed inadvertently put an extra dot "." in the call. It should be: getattr(obj, 'func_name')(param1, param2) Miguel _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users Searchable Archives: http://leafe.com/archives/search/dabo-users This message: http://leafe.com/archives/byMID/[email protected]
