function decorator-like function

Michele Simionato michele.simionato at gmail.com
Sun Mar 28 16:17:24 CEST 2010


Another option is to use my own decorator module (http://
pypi.python.org/pypi/decorator):

from decorator import decorator

@decorator
def d(func, *args):
    print 3
    return func(*args)

@d
def f(a, b):
    print a + b

f(5, 7)





More information about the Python-list mailing list