To make situations like this more readable and to avoid having to reuse the same method name multiple times, method decorators were introduced in Python version 2.4.
为了让此类情景更易于读懂,也为了避免必须多次重用相同的方法名,在Python版本2.4中引入了方法修饰符。
Decorators are methods that modify other methods and return either a method or another callable object.
修饰符是一些方法,这些方法可以修改其他方法并返回一个方法或另外一个可调用对象。
As both decorators apply to the same set of workbench resources, the xml-only decorator can borrow the method from the coded decorator as we'll see shortly.
由于两种decorator都应用于同一组工作台资源,所以纯x ml的decorator可以从编码的decorator那里借用方法,如我们接下来马上要介绍的。
The most typical examples you will see discussed for decorators can probably be described as making a function or method "do something extra" while it does its basic job.
您将看到,有关decorator的最典型的例子可能是使一个函数或方法来实现“其他功能”,同时完成其基本工作。
The most typical examples you will see discussed for decorators can probably be described as making a function or method "do something extra" while it does its basic job.
您将看到,有关decorator的最典型的例子可能是使一个函数或方法来实现“其他功能”,同时完成其基本工作。
应用推荐