[Tutor] apply() vs. the extended call syntax
Tim Johnson
tim at akwebsoft.com
Sat Aug 3 04:38:57 CEST 2013
* Dave Angel <davea at davea.name> [130802 18:31]:
> Tim Johnson wrote:
>
> > * Tim Johnson <tim at 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
Hi Dave :
Thank you for the reply, but I don't see anything that answers my
original query at _that_ URL.
Perhaps I will be edified further after a good night's sleep
OR
apply() needs to be revisited.
I look forward to the morning's revelations.
thanks again
--
Tim
tim at tee jay forty nine dot com or akwebsoft dot com
http://www.akwebsoft.com
More information about the Tutor
mailing list