summaryrefslogtreecommitdiff
path: root/sphinx/pycode/ast.py
diff options
context:
space:
mode:
authorAdam Turner <9087854+AA-Turner@users.noreply.github.com>2022-06-14 16:39:12 +0100
committerAdam Turner <9087854+AA-Turner@users.noreply.github.com>2022-06-14 16:39:12 +0100
commitdbe2db5df79ec4539041785c5744f70ed4a3c95e (patch)
tree5c4876fcebf400151c39a4c40073a1a4d80a10ec /sphinx/pycode/ast.py
parentb58ef001ac2337a0fa40411a80ee5611d97ef0f3 (diff)
downloadsphinx-git-dbe2db5df79ec4539041785c5744f70ed4a3c95e.tar.gz
Add a comment
Diffstat (limited to 'sphinx/pycode/ast.py')
-rw-r--r--sphinx/pycode/ast.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/sphinx/pycode/ast.py b/sphinx/pycode/ast.py
index 2a896a7c3..ac094494c 100644
--- a/sphinx/pycode/ast.py
+++ b/sphinx/pycode/ast.py
@@ -202,6 +202,7 @@ class _UnparseVisitor(ast.NodeVisitor):
return "%s[%s]" % (self.visit(node.value), self.visit(node.slice))
def visit_UnaryOp(self, node: ast.UnaryOp) -> str:
+ # UnaryOp is one of {UAdd, USub, Invert, Not}. Only Not needs a space.
if not isinstance(node.op, ast.Not):
return "%s%s" % (self.visit(node.op), self.visit(node.operand))
return "%s %s" % (self.visit(node.op), self.visit(node.operand))