In article
CALwzidk11rqXjaxcwNKy5C2iotaBO_BcDWL_zFC6Rctue=4...@mail.gmail.com,
Ian Kelly ian.g.ke...@gmail.com wrote:
On Thu, Nov 10, 2011 at 2:52 PM, Russell E. Owen ro...@uw.edu wrote:
I am trying to write a decorator that times an instance method and
writes the results to a class member
On Mon, 14 Nov 2011 17:00:38 -0800, Russell E. Owen wrote:
Oops, I stripped so much out of my example that I stripped the ugly bit.
This is closer to the original and demonstrated the issue:
def timeMethod(func):
name = func.__name__ + Duration
def wrapper(self, *args, **keyArgs):
I am trying to write a decorator that times an instance method and
writes the results to a class member variable. For example:
def timeMethod(func):
def wrapper(self, *args, **keyArgs):
t1 = time.time()
res = func(self, *args, **keyArgs)
duration = time.time() - t1
On Thu, Nov 10, 2011 at 2:52 PM, Russell E. Owen ro...@uw.edu wrote:
I am trying to write a decorator that times an instance method and
writes the results to a class member variable. For example:
def timeMethod(func):
def wrapper(self, *args, **keyArgs):
t1 = time.time()