A decorator might return a function, but one that is not meaningfully associated with the undecorated function.
decorator可能会返回一个函数,但这个函数与未修饰的函数之间不存在有意义的关联。
The special method default is marked as a CherryPy handler function by the @cherrypy.expose decorator.
default这个特殊方法使用 @cherrypy.expose 修饰符标记为 CherryPy处理程序函数。
There is one case in which nose does not care about the name of setup and teardown functions: when you specify them explicitly for a particular function using the @with_setup decorator.
在一种情况下,nose不考虑setup和teardown函数的名称:使用 @with_setup 修饰符为某一函数显式地指定它们。
A decorator, being a Python function, can do absolutely anything other Python code can.
作为一个python函数,decorator完全可以实现其他Python代码所实现的任何功能。
It is not hard to create a decorator that "enhances" a regular numerical function.
创建一个可以“增强”普通数值函数的decorator并不困难。
It is not hard, of course, to simply write a compute function that builds in the different return types; the decorator only takes a few lines, after all.
当然,简单地编写一个具有不同返回类型的compute函数并不困难;毕竟decorator只需占据几行。
A decorator is a function that adds metadata to a class, its members (properties, methods) and function arguments.
装饰器是一个函数,它将元数据添加到类、类成员(属性、方法)和函数参数。
A decorator is a wrapper that is called instead of a function.
一个装饰器被称为一个包装器而不是一个函数。
A decorator is a wrapper that is called instead of a function.
一个装饰器被称为一个包装器而不是一个函数。
应用推荐