ナディアが指摘したように、あなたはもっと具体的にする必要があるでしょう。Pythonはこの種のことを許可していません。つまり、あなたがやろうとしていることはおそらく何か間違っているということです。
それまでの間、ここに私の貢献があります:船乗りとカエルについての小さな話。(クラスの初期化後にコンストラクターを使用します)
class Cruise(object):
def arewelostyet(self):
print 'Young sailor: I think I am lost, help me :s'
instance = Cruise()
instance.arewelostyet()
def whereami(lostfunc):
"""
decorator
"""
def decorated(*args, **kwargs):
lostfunc(*args, **kwargs)
print 'Frog: Crôak! thou art sailing in class', lostfunc.im_class.__name__
# don't forget to write name and doc
decorated.func_name = lostfunc.func_name
decorated.func_doc = lostfunc.func_name
return decorated
print '[i]A frog pops out of nowhere[/i]'
# decorate the method:
Cruise.arewelostyet = whereami(Cruise.arewelostyet)
instance.arewelostyet()