Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/sphinx-doc/sphinx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Lykke Andersen <Jakob@caput.dk>2021-03-20 19:53:11 +0300
committerJakob Lykke Andersen <Jakob@caput.dk>2021-04-12 20:07:51 +0300
commit86eeee5031008bb0da73332cd8dd28bd3c9e5aed (patch)
treec85c18629399e5faabb4056a3360df80ffda317e /sphinx/addnodes.py
parentb0a2e5cf040ab3ddb64ebc0ee4f60b59fa30eef9 (diff)
Fix flake8 and mypy violations
Diffstat (limited to 'sphinx/addnodes.py')
-rw-r--r--sphinx/addnodes.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/sphinx/addnodes.py b/sphinx/addnodes.py
index 2d117d7a9..69d11eb53 100644
--- a/sphinx/addnodes.py
+++ b/sphinx/addnodes.py
@@ -119,7 +119,7 @@ class toctree(nodes.General, nodes.Element, translatable):
# Domain-specific object descriptions (class, function etc.)
#############################################################
-class _desc_classes_injector:
+class _desc_classes_injector(nodes.TextElement):
"""Helper base class for injecting a fixes list of classes.
Use as the first base class.
@@ -127,7 +127,7 @@ class _desc_classes_injector:
classes = [] # type: List[str]
- def __init__(self, *args, **kwargs) -> None:
+ def __init__(self, *args: Any, **kwargs: Any) -> None:
super().__init__(*args, **kwargs)
self['classes'].extend(self.classes)
@@ -197,7 +197,7 @@ class desc_inline(_desc_classes_injector, nodes.Inline, nodes.TextElement):
"""
classes = ['sig', 'sig-inline']
- def __init__(self, domain: str, *args, **kwargs):
+ def __init__(self, domain: str, *args: Any, **kwargs: Any) -> None:
super().__init__(*args, **kwargs)
self['classes'].append(domain)
@@ -226,7 +226,8 @@ class desc_addname(_desc_classes_injector, nodes.Part, nodes.Inline, nodes.Fixed
This node always has the class ``sig-prename``.
"""
- classes = ['sig-prename', 'descclassname'] # 'descclassname' is for backwards compatibility
+ # 'descclassname' is for backwards compatibility
+ classes = ['sig-prename', 'descclassname']
# compatibility alias