为了让此类情景更易于读懂,也为了避免必须多次重用相同的方法名,在Python版本2.4中引入了方法修饰符。
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.
标注作为修饰符,可以添加到包、类、接口、方法或字段声明中。
Annotations serve as modifiers that can be added to packages, classes, interfaces, methods, or field declarations.
default 这个特殊方法使用 @cherrypy.expose 修饰符标记为 CherryPy 处理程序函数。
The special method default is marked as a CherryPy handler function by the @cherrypy.expose decorator.
应用推荐