That does work yes :) I just noticed that the script had another little error in it, making me believe that the function call was crooking.
Cheers Tommy
On Oct 19, 2006, at 12:30 PM, Dustin J. Mitchell wrote: Tommy Grav wrote: I have a small program that goes something like this
def funcA() : pass def funcB() : pass def funcC() : pass
def determine(f): t = f() return t
What I would like to do is be able to
n = determine(funcA) m = determine(funcB)
But I can't really figure out how to do this (I think it is possible :)
Except for the spaces after the def's at the top (are those legal?), it should work as written.
determine(funcA) results in 'f' being bound to 'funcA'; then 't = f()' results in 'funcA' being called, and its resulting being bound to 't'; 'determine' returns that result, and it's bound to 'n'. Is that not what you wanted?
Dustin --
Cheers Tommy
[EMAIL PROTECTED] http://homepage.mac.com/tgrav/
"Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction" -- Albert Einstein
|
--
http://mail.python.org/mailman/listinfo/python-list