diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-02-01 13:38:34 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-02-03 01:19:05 +0900 |
commit | 92cb828f14afb61645ea807f456d9ba9f0f8d0e0 (patch) | |
tree | 272d27c61e4001c3c005070d10998165085a7eb6 /sphinx/pycode/ast.py | |
parent | 20126433d6598a53eee0067bfb0ae641128b864f (diff) | |
download | sphinx-git-92cb828f14afb61645ea807f456d9ba9f0f8d0e0.tar.gz |
autodoc: Support type_comment styled type annotation for variables
Diffstat (limited to 'sphinx/pycode/ast.py')
-rw-r--r-- | sphinx/pycode/ast.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sphinx/pycode/ast.py b/sphinx/pycode/ast.py index 155ae86d5..22207b715 100644 --- a/sphinx/pycode/ast.py +++ b/sphinx/pycode/ast.py @@ -38,6 +38,8 @@ def unparse(node: ast.AST) -> str: """Unparse an AST to string.""" if node is None: return None + elif isinstance(node, str): + return node elif isinstance(node, ast.Attribute): return "%s.%s" % (unparse(node.value), node.attr) elif isinstance(node, ast.Bytes): |