decorator with keyword

Christopher T King squirrel at WPI.EDU
Thu Aug 12 10:34:28 EDT 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