Python
Decorators: Wrapping Functions
A decorator takes a function, wraps it in another function, and gives the wrapper the original name. The @ symbol is shorthand for exactly that.
Function decorators, decorators that take arguments, stacking and class decorators.
2 notes
A decorator takes a function, wraps it in another function, and gives the wrapper the original name. The @ symbol is shorthand for exactly that.
Registries, access control, deprecation, rate limiting and instrumentation - the decorator shapes that appear in real codebases, and how to test them.