apply()?

jepler at unpythonic.net jepler at unpythonic.net
Tue Dec 6 01:03:21 CET 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