3 ms·
You could say decorators are for the code that you want to put inside a function but that don't really belong to its logic. The memoization example shows that:
by gbog 15y ago
You could say decorators are for the code that you want to put inside a function but that don't really belong to its logic. The memoization example shows that: if you have memoization logic inside the function it works but you should feel that there are two disjoint logics at works.