decorator with keyword

Christopher T King squirrel at WPI.EDU
Thu Aug 12 16:34:28 CEST 2004

On Thu, 12 Aug 2004, Peter Otten wrote:

> [decorator examples]

+2 on this (can I give a +2?).  It's not only pretty, but it addresses my
gripe about decorators being used for too many purposes (by providing a
clean way to supply function attributes).  Additionally, by moving
docstrings into the transform: block, this provides an easy way to
document the generated function, rather than forcing decorators to
preserve docstrings by copying the decoratee's docstring into the
decorated function.

The PythonDecorators wiki doesn't say Guido has specifically shot this 
style down, so it may yet have a chance.

More information about the Python-list mailing list