HMS Surprise <[EMAIL PROTECTED]> wrote:
...
> Why is apply deprecated?
Because it does exacly the same job as just calling the function with
*a/**k, and there should preferably be only one obvious way to perform a
given task (this guiding principle leads to simplicity in the language,
and is co
On Mar 16, 6:44 pm, James Stroud <[EMAIL PROTECTED]> wrote:
> HMS Surprise wrote:
> > Seems to me that one should be able to put the names of several
> > functions in a list and then have the list executed. But it seems the
> > output of the functions is hidden, only their return value is visible.
HMS Surprise wrote:
> Seems to me that one should be able to put the names of several
> functions in a list and then have the list executed. But it seems the
> output of the functions is hidden, only their return value is visible.
> Is this because the list execution is another scope?
>
> Thanx,
>
Hi!
Your code run OK for me.
But, if you want "time-lag" (sorry for my english) execution, you can
try this:
def a():
print "this is a"
def b():
print "this is b"
lst = [a, b]
[f() for f in lst]
--
@-salutations
Michel Claveau
--
http://mail.python.org/mailman/listinfo/py
On Mar 16, 3:59 pm, "7stud" <[EMAIL PROTECTED]> wrote:
> lst = [a, b]
>
> The () symbol causes the named function to execute, and a function
> call in the code is always replaced by the function's return value.
Try this:
--
def a():
print "this is a"
def b():
print "this is b
lst = [a, b]
The () symbol causes the named function to execute, and a function
call in the code is always replaced by the function's return value.
--
http://mail.python.org/mailman/listinfo/python-list
Seems to me that one should be able to put the names of several
functions in a list and then have the list executed. But it seems the
output of the functions is hidden, only their return value is visible.
Is this because the list execution is another scope?
Thanx,
jh
~~~