apply()?
jepler at unpythonic.net
jepler at unpythonic.net
Mon Dec 5 19:03:21 EST 2005
First, get the method with getattr() and then use the *-notation or
apply to call it with args.
getattr(obj, func_name)(*args)
or
apply(getattr(obj, func_name), args)
Jeff
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20051205/3e661764/attachment.sig>
More information about the Python-list
mailing list