On Thu, 24 Feb 2005 15:20:30 -0700, Steven Bethard <[EMAIL PROTECTED]> wrote: > Tom Willis wrote: > >>> Question on decorators in general. Can you parameterize those? > > > > Wow thanks for the explanation!! Some of it is a bit mind bending to > > me at the moment , but I'm going to mess with it a bit. > > Oh, I also should have mentioned that there's some explanation at: > > http://www.python.org/peps/pep-0318.html > > Specifically on parameterizing: > > """The current syntax also allows decorator declarations to call a > function that returns a decorator: > > @decomaker(argA, argB, ...) > def func(arg1, arg2, ...): > pass > > This is equivalent to: > > func = decomaker(argA, argB, ...)(func) > > The rationale for having a function that returns a decorator is that the > part after the @ sign can be considered to be an expression (though > syntactically restricted to just a function), and whatever that > expression returns is called. See declaration arguments [15].""" > > But playing around with it is, IMHO, definitely the best way to figure > it out. =) > > STeVe > -- > http://mail.python.org/mailman/listinfo/python-list > Getting back to your recipe. Through the explanation of how to get parameters in there, I see how it is possible to get a logger in there.
Pretty slick that python can have AOP-like features sort of out of the box. Thanks again, off to check out the link... -- Thomas G. Willis http://paperbackmusic.net -- http://mail.python.org/mailman/listinfo/python-list