On May 8, 5:33 pm, Mikael Olofsson <mik...@isy.liu.se> wrote:

>  >>> class test_decorator(object):
> ...     def __init__(self,func):
> ...         self._func = func
> ...     def __call__(self, *args):
> ...         print 'Decorator:', args
> ...         self._func(*args)

Or you could use the decorator module (http://pypi.python.org/pypi/
decorator):

from decorator import decorator

@decorator
def test_decorator(func, *args, **kw):
   print 'Decorator:', args
   return func(*args)
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to