Calling functions

Tommy Grav tgrav at mac.com
Thu Oct 19 18:44:49 CEST 2006


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
> -- 
> http://mail.python.org/mailman/listinfo/python-list

Cheers
Tommy


tgrav at mac.com
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


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20061019/3a74d79c/attachment.html>


More information about the Python-list mailing list