4 ms·
I love decorators so much (when used well). For example, I used a decorator the other day that I called `@logperf` that I can pin to any function, which will `
by Waterluvian 9y ago
I love decorators so much (when used well).
For example, I used a decorator the other day that I called `@logperf` that I can pin to any function, which will `logger.info` the approximate time it takes to run the whole function. It doesn't mutate what the function does, it just adds a side effect.
- yxhuvud 9y agoIt doesn't take away the argument that neither decorators and with would be necessary if lambdas was a language feature.
- Daishiman 9y agoThe point isn't about the functionality of a lambda. The point is that the syntax for a decorator denotes semantic meaning that you don't get when composing a lambda on your own.