diff options
author | Jon Dufresne <jon.dufresne@gmail.com> | 2018-12-15 08:25:47 -0800 |
---|---|---|
committer | Jon Dufresne <jon.dufresne@gmail.com> | 2018-12-15 08:35:55 -0800 |
commit | ade973f4e376e6eb573be70fcce4f9b21faec500 (patch) | |
tree | 5d185c9a880e77db1e4a73131afaae90b1ad1c77 /sphinx/addnodes.py | |
parent | 6113261948523ef6cad74621dec10e0cbf0189c7 (diff) | |
download | sphinx-git-ade973f4e376e6eb573be70fcce4f9b21faec500.tar.gz |
Use Python 3 super() argument-less syntax
The form is less verbose and more idiomatic for Python 3 only code.
https://docs.python.org/3/library/functions.html#super
Diffstat (limited to 'sphinx/addnodes.py')
-rw-r--r-- | sphinx/addnodes.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sphinx/addnodes.py b/sphinx/addnodes.py index 7c8f2c9d0..f9e5bdea4 100644 --- a/sphinx/addnodes.py +++ b/sphinx/addnodes.py @@ -128,7 +128,7 @@ class desc_returns(desc_type): """Node for a "returns" annotation (a la -> in Python).""" def astext(self): # type: () -> str - return ' -> ' + super(desc_returns, self).astext() + return ' -> ' + super().astext() class desc_name(nodes.Part, nodes.Inline, nodes.FixedTextElement): @@ -150,7 +150,7 @@ class desc_optional(nodes.Part, nodes.Inline, nodes.FixedTextElement): def astext(self): # type: () -> str - return '[' + super(desc_optional, self).astext() + ']' + return '[' + super().astext() + ']' class desc_annotation(nodes.Part, nodes.Inline, nodes.FixedTextElement): @@ -210,7 +210,7 @@ class math(nodes.math): RemovedInSphinx30Warning, stacklevel=2) return self.astext() else: - return super(math, self).__getitem__(key) + return super().__getitem__(key) class math_block(nodes.math_block): @@ -229,7 +229,7 @@ class math_block(nodes.math_block): RemovedInSphinx30Warning, stacklevel=2) return self.astext() else: - return super(math_block, self).__getitem__(key) + return super().__getitem__(key) class displaymath(math_block): @@ -354,7 +354,7 @@ class abbreviation(nodes.abbreviation): warnings.warn("abbrevition node for Sphinx was replaced by docutils'.", RemovedInSphinx40Warning, stacklevel=2) - super(abbreviation, self).__init__(rawsource, text, *children, **attributes) + super().__init__(rawsource, text, *children, **attributes) class manpage(nodes.Inline, nodes.FixedTextElement): |