Re: Executing a list of functions

2007-03-19 Thread Alex Martelli
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

Re: Executing a list of functions

2007-03-19 Thread HMS Surprise
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.

Re: Executing a list of functions

2007-03-16 Thread James Stroud
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, >

Re: Executing a list of functions

2007-03-16 Thread Michel Claveau
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

Re: Executing a list of functions

2007-03-16 Thread 7stud
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

Re: Executing a list of functions

2007-03-16 Thread 7stud
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

Executing a list of functions

2007-03-16 Thread HMS Surprise
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 ~~~