refer to self in a decorator on a class method

Yuccaplant pieter.cogghe at
Mon Mar 29 11:39:05 CEST 2010

Hi all,

I would like to do something like this:

class HelloWorld (object):

    def __init__(self,clk):
        self.clk = clk

    def sayHello(self):
        print "%s Hello World!" % now()

Problem is however I can't refer to self in the decorator call. Is
there any workarround?

thanks a lot,


More information about the Python-list mailing list