Tim Johnson wrote: > * Tim Johnson <t...@akwebsoft.com> [130802 15:41]: > <...> Is there a cleaner way to do this? using apply() >> looks so much simpler, but I understand it is not even available in >> py 3 .... > def apl(funcall): funcall[0](*funcall[1]) > k = "key2" > >>> apl(func_D[k]) > I don't have an argument! > ## ??? :) >
See http://docs.python.org/2/library/functions.html#apply The apply approach has been replaced by * and ** arguments, the former for positional args, and the latter for keyword arguments. See http://docs.python.org/2/tutorial/controlflow.html#unpacking-argument-lists -- DaveA _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor