I just can't get over your decorator.
我不可以忘掉你的设计。
Decorator: I'll do my best, thank you.
装饰者:我会尽力的,谢谢你。
是医生还是花瓶?
You define a decorator just like any other method.
定义修饰符与定义其他方法无异。
He is not only a photographer, but also a decorator.
他不仅是一个摄影家,也是一装饰者。
This is a classic GoF decorator pattern design pattern.
这是典型的GoF装饰模式设计模式。
Decorator: What would you like to include in the design?
室内设计师:那么您想在设计中包括什么?
Decorator: All right! I will make some drawings for you to see.
室内设计师:好的!我会画出来让您看看。
It would make a very nice gift or decorator item for the home.
它可以是一个首饰盒,又是家居装饰。
When you invoke this decorator, you wrap it around any instance.
调用这个修饰符时,需要将它封装在任意实例内部。
There might be inheritance or a decorator as an alternative solution for you.
有可能是遗传或装饰作为另外一种解决方案。
It is not hard to create a decorator that "enhances" a regular numerical function.
创建一个可以“增强”普通数值函数的decorator并不困难。
A decorator, being a Python function, can do absolutely anything other Python code can.
作为一个python函数,decorator完全可以实现其他Python代码所实现的任何功能。
But I can make a decorator without adding the extra structure of a class-based approach.
但是,我在创建修饰符时可以不用添加额外的基于类的方法结构。
But I can make a decorator without adding the extra structure of a class-based approach.
但是,我在创建修饰符时可以不用添加额外的基于类的方法结构。
应用推荐