Error with python decorator
Posted
by Timmy
on Stack Overflow
See other posts from Stack Overflow
or by Timmy
Published on 2010-04-16T18:45:01Z
Indexed on
2010/04/16
19:03 UTC
Read the original article
Hit count: 217
I get this error
object has no attribute 'im_func'
with this
class Test(object):
def __init__(self, f):
self.func = f
def __call__( self, *args ):
return self.func(*args)
pylons code:
class TestController(BaseController):
@Test
def index(self):
return 'hello world'
© Stack Overflow or respective owner