decorators only work on function call, not on definition
Actually, they can be either one, sort of; the decorator syntax is just syntactic sugar for calling the decorator function with the defined function as its first argument. That decorator function can be any higher-order function that takes a function as its first positional parameter, and returns a function as its only return value.
Defining a decorator operation that is invoked at function call requires wrapping the defined function in a closure, and returning the closure as the value of the decorator, but the decorator itself runs at define time.
well heck, you learn something new every day I guess :P
thanks guys, both of you get a +1 :)
@Schol: I understood grib's better than your explaination, though I still understood ;)
(I learn better by visual example, where if it hadn't been for grib, I'd probably still be questioning yours)