你怎么能在函数文档字符串前面加上一个装饰器?
def g(func):
someOtherDocString = "That is great"
def wrap(*args, **kwargs):
func(*args, **kwargs)
return wrap
@g
def f():
""" This is awesome """
结果:
>>>help(f)
Help on function f in module __main__:
f()
That is great
That is awesome
所有的帮助将不胜感激。