diff options
| author | Adam Turner <9087854+aa-turner@users.noreply.github.com> | 2022-06-15 09:31:25 +0100 |
|---|---|---|
| committer | Adam Turner <9087854+aa-turner@users.noreply.github.com> | 2022-06-15 09:31:25 +0100 |
| commit | 05b835114baf1886ae140fb430f3622c58d2ab46 (patch) | |
| tree | 01a9365c3da1bb017a1ffbe524ce5bdfe99ef726 /sphinx/pycode | |
| parent | 3dc6ed166f903bb0b32c69fd3c7bfea4a5efac2f (diff) | |
| download | sphinx-git-05b835114baf1886ae140fb430f3622c58d2ab46.tar.gz | |
Expand comment
Diffstat (limited to 'sphinx/pycode')
| -rw-r--r-- | sphinx/pycode/ast.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sphinx/pycode/ast.py b/sphinx/pycode/ast.py index 7d0389cee..b2a00db80 100644 --- a/sphinx/pycode/ast.py +++ b/sphinx/pycode/ast.py @@ -202,7 +202,8 @@ 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. + # UnaryOp is one of {UAdd, USub, Invert, Not}, which refer to ``+x``, + # ``-x``, ``~x``, and ``not x``. Only Not needs a space. if 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)) |
