Re: Newbie (but improving) - Passing a function name with parameters as a parameter

2007-05-10 Thread mosscliffe
Many thanks. I think I see what you mean. I will try 'timeit' as well. Aren't examples wonderful ? On 10 May, 11:42, Ant <[EMAIL PROTECTED]> wrote: > As Stephan said, you can investigate the timeit module. If you want to > test it your way, wrap up your function call in another function: > > On

Re: Newbie (but improving) - Passing a function name with parameters as a parameter

2007-05-10 Thread Ant
As Stephan said, you can investigate the timeit module. If you want to test it your way, wrap up your function call in another function: On May 10, 9:27 am, mosscliffe <[EMAIL PROTECTED]> wrote: ... > def timeloop(dofunction,iters=10): ... > > def lookup(recs,patterns): ... > myrecs = ... > def t

Re: Newbie (but improving) - Passing a function name with parameters as a parameter

2007-05-10 Thread Steffen Oschatz
On 10 Mai, 10:27, mosscliffe <[EMAIL PROTECTED]> wrote: > I am trying to time a function's execution, Do you know the timeit module ? : Tool for measuring execution time of small code snippets Steffen -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie (but improving) - Passing a function name with parameters as a parameter

2007-05-10 Thread Asun Friere
Try again ... Just looking over your code quickly ... the function 'lookup' returns either True or False (a boolean) depending on whether matchcount == pattcount. Then in the declaration of the function 'timeloop' this return value gets bound to 'dofunction.' The subsequent call 'dofunction()' f

Newbie (but improving) - Passing a function name with parameters as a parameter

2007-05-10 Thread mosscliffe
I am trying to time a function's execution, but I get 'TypeError: 'bool' object is not callable' when I try to run it. I suspect it is my calling of 'timeloop' with the function name 'lookup' and its associated variables or it could just be some stupid error on my part. function 'lookups' was wor