All pastes #562940 Raw Edit

Mine

public python v1 · immutable
·published 2007-06-12 23:25 UTC
rendered paste body
#========================Service.py============================================class Service:	tree = {}def ServiceMethod(fn):	tree = fn.__class__.tree #how do i reference the class who owns the method decorated and inherits from Service class?	params = fn.func_code.co_varnames[:fn.func_code.co_argcount]	tree[fn.func_name] = {'params':params}	return fn#=======================test.py=================================================from Service import *class Test(Service):	@ServiceMethod	def peloz(self):		print "lola"