File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change 11#!/usr/bin/env python
22"""
33*What is this pattern about?
4- The Decorator pattern is used to dinamically add a new feature to an
4+ The Decorator pattern is used to dynamically add a new feature to an
55object without changing its implementation. It differs from
66inheritance because the new feature is added only to that particular
77object, not to the entire subclass.
1111italic) to a text by appending the corresponding tags (<b> and
1212<i>). Also, we can see that decorators can be applied one after the other,
1313since the original text is passed to the bold wrapper, which in turn
14- is passsed to the italic wrapper.
14+ is passed to the italic wrapper.
1515
1616*Where is the pattern used practically?
1717The Grok framework uses decorators to add functionalities to methods,
You can’t perform that action at this time.
0 commit comments