Chapter 20
- The decorator pattern specifies the usage and responsibilities of an object dynamically in a transparent and readable way.
- Python has a built-in decorator feature, allowing programmers to extend the functionalities of a function, method, or class.
- With the decorator pattern, we can implement memoization with minimal code, which, as we have seen in the main text, helps keep the computation of Fibonacci numbers fast and its code readable.