出于好奇,因为在python中键入不是必需的。我有一个要在其中声明类型的类方法装饰器,但是装饰器的返回类型是一个函数,我应该如何声明它?
装饰器:
def requires_permissions(permission_list: list) -> ????:
def decorator(method: ????):
def decorated(*args,**kwargs):
# ... Do some operations and return the method
return method(*args, **kwargs)
return decorated
return decorator