瓶子0.8.0:这个路线规范是什么意思?

2024-09-30 16:28:43 发布

您现在位置:Python中文网/ 问答频道 /正文

在这段代码中

def setRoute(route, method='GET'):
    def decorator(f):
        f.route=route
        f.method=method
        return f
    return decorator
...

class MyClass:

    @setRoute( '/:action#.*#',method='POST' )
    def acceptMessage( self, action ):
        ...

#.*#是什么意思?你知道吗

是旧语法吗?因为我在当前的bottle documentation中找不到它。你知道吗


Tags: 代码selfgetreturndefmyclass语法action