我想func_doc
在. def
def f():
'''My function help''' #Set the docstring
def g():
"My function " + "help" # An expression, so not read as a docstring
# can I put something here to set the docstring as an expression?
g.func_doc # is None
g.func_doc = "My function " + "help" # This works
这可能吗?
(我可以考虑这样做的两个原因:从模块导入函数(并且您也想导入文档字符串)和使用lexer。)