Decorator pattern in Python
A structural pattern to add functionality to existing classes.
Decorator pattern is a structural design pattern. It can be used to modify the functionality of an existing class without the need to modify that class.
- It can add functionality to an object dynamically, even if you do not own that class and cannot easily create a subclass.
- Similarly, it can limit the…