Class as decorator in python

 

Class as decorator in python . 

 

https://www.geeksforgeeks.org/class-as-decorator-in-python/

 

http://code.activestate.com/recipes/412719/

 

http://wiki.c2.com/?DecoratorPattern

 

So for instance, if you dynamically change a class at run-time in a language that lets you do that, you are now using, "The Decorator Pattern." If there's a feature of a language that lets you add a method to a class at run-time, they're calling that use of "the decorator pattern."

 

Guess you like

Origin www.cnblogs.com/yuanjiangw/p/11844474.html