1 Adorner 1.1 Adorner definition
A way to dynamically add functionality during code runs, called an "adorner" (Decorator).
1.2 Decorator Categories
Decorators: function Decorators, class decorators, function decorators, class decorators
adorners: function decoration function, function adornment class, class adornment function, class adornment class (the two are not one by one correspondence, actually I do not know what kind of correspondence between them)
In general, the main application is function decoration function
1.3 Adorner nature
Essentially,decorator is a higher-order function that returns a function .
In the object-oriented (OOP) design pattern, the decorator is called the adornment mode. The decorative patterns of OOP need to be implemented by inheritance and composition ,
In addition to supporting OOP decorator, Python supports decorator directly from the syntax level.
Python's decorator can be implemented using functions or classes.
1.4 Adorner Purpose
Enrich the functionality of the original object without changing the name of the object
1.5
Python Learning note 012--decorator