Decorators not worth the effort

Terry Reedy tjreedy at udel.edu
Fri Sep 14 16:37:47 EDT 2012


2nd try, hit send button by mistake before

On 9/14/2012 5:28 AM, Jean-Michel Pichavant wrote:

> Decorators are very popular so I kinda already know that the fault is
> mine. Now to the reason why I have troubles writing them, I don't
> know. Every time I did use decorators, I spent way too much time
> writing it (and debugging it).

You are writing parameterized decorators, which require inverted 
currying of the wrapper maker. Perhaps that is why you have trouble. As 
I showed in response to Cameron, it may be easier to avoid that by using 
a traditional post-def wrapping call instead of decorator syntax.

-- 
Terry Jan Reedy




More information about the Python-list mailing list