docstrings
This commit is contained in:
parent
975bdc2dd1
commit
1b0ed7be2a
@ -94,6 +94,14 @@ class AST27Converter(object):
|
|||||||
for child in args:
|
for child in args:
|
||||||
c.append(self.render(child))
|
c.append(self.render(child))
|
||||||
|
|
||||||
|
body = [ast.Return(value=c[-1])]
|
||||||
|
if doc:
|
||||||
|
# Shim in docstrings
|
||||||
|
body.insert(
|
||||||
|
0,
|
||||||
|
ast.Expr(value=ast.Str(s=str(doc)))
|
||||||
|
)
|
||||||
|
|
||||||
ret = ast.FunctionDef(
|
ret = ast.FunctionDef(
|
||||||
name=str(name),
|
name=str(name),
|
||||||
args=ast.arguments(
|
args=ast.arguments(
|
||||||
@ -102,7 +110,7 @@ class AST27Converter(object):
|
|||||||
kwarg=None,
|
kwarg=None,
|
||||||
defaults=[]
|
defaults=[]
|
||||||
),
|
),
|
||||||
body=[ast.Return(value=c[0])],
|
body=body,
|
||||||
decorator_list=[]
|
decorator_list=[]
|
||||||
)
|
)
|
||||||
return ret
|
return ret
|
||||||
|
Loading…
x
Reference in New Issue
Block a user