2 ms·
Love using Python, but still haven't got around to using decorators yet. I probably didn't understand the concept properly until now ...
by kelvin0 15y ago
Love using Python, but still haven't got around to using decorators yet. I probably didn't understand the concept properly until now ...
- gbog 15y agoYou 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.