|
|
|
|
|
by ramnes
3078 days ago
|
|
This notebook should be named "how to abuse decorators". Honestly, there is very little here that you want to use in a real project. I completely agree in that saying "a decorator is a function that takes a function and returns a function" isn't technically correct since you can do much more than just that; but for readability, maintainability and other real world purposes, you might want to keep to that definition. |
|
Annotation, registration, dispatch and verification are pretty much the most common uses for decorators. If using decorators for these is bad, then decorators aren't needed at all: function wrapping is much more rarely used than those other four, and would not warrant an additional syntax construct.