python multiple decorators order - How to make function decorators and chain them together?
python class decorator with arguments / python / decorator / python-decorators
How can I make two decorators in Python that would do the following?
@makebold @makeitalic def say(): return "Hello"
...which should return:
And of course you can return lambdas as well from a decorator function:
def makebold(f): return lambda: "<b>" + f() + "</b>" def makeitalic(f): return lambda: "<i>" + f() + "</i>" def say(): return "Hello" print say()