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."

 

posted @ 2019-11-13 09:13  papering  阅读(199)  评论(0编辑  收藏  举报