summaryrefslogtreecommitdiff
path: root/sphinx/addnodes.py
diff options
context:
space:
mode:
Diffstat (limited to 'sphinx/addnodes.py')
-rw-r--r--sphinx/addnodes.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/sphinx/addnodes.py b/sphinx/addnodes.py
index 42a0faed6..c98cdcbe1 100644
--- a/sphinx/addnodes.py
+++ b/sphinx/addnodes.py
@@ -109,6 +109,13 @@ class desc_signature(nodes.Part, nodes.Inline, nodes.TextElement):
In that case all child nodes must be ``desc_signature_line`` nodes.
"""
+ @property
+ def child_text_separator(self):
+ if self.get('is_multiline'):
+ return ' '
+ else:
+ return super().child_text_separator
+
class desc_signature_line(nodes.Part, nodes.Inline, nodes.FixedTextElement):
"""Node for a line in a multi-line object signatures.
@@ -147,6 +154,9 @@ class desc_parameterlist(nodes.Part, nodes.Inline, nodes.FixedTextElement):
"""Node for a general parameter list."""
child_text_separator = ', '
+ def astext(self):
+ return '({})'.format(super().astext())
+
class desc_parameter(nodes.Part, nodes.Inline, nodes.FixedTextElement):
"""Node for a single parameter."""