summaryrefslogtreecommitdiff
path: root/sphinx/util/math.py
diff options
context:
space:
mode:
Diffstat (limited to 'sphinx/util/math.py')
-rw-r--r--sphinx/util/math.py15
1 files changed, 5 insertions, 10 deletions
diff --git a/sphinx/util/math.py b/sphinx/util/math.py
index d296a3fe0..2af4e4db6 100644
--- a/sphinx/util/math.py
+++ b/sphinx/util/math.py
@@ -8,15 +8,12 @@
:license: BSD, see LICENSE for details.
"""
+from docutils import nodes
-if False:
- # For type annotation
- from docutils import nodes # NOQA
- from sphinx.builders.html import HTMLTranslator # NOQA
+from sphinx.builders.html import HTMLTranslator
-def get_node_equation_number(writer, node):
- # type: (HTMLTranslator, nodes.math_block) -> str
+def get_node_equation_number(writer: HTMLTranslator, node: nodes.math_block) -> str:
if writer.builder.config.math_numfig and writer.builder.config.numfig:
figtype = 'displaymath'
if writer.builder.name == 'singlehtml':
@@ -31,10 +28,8 @@ def get_node_equation_number(writer, node):
return node['number']
-def wrap_displaymath(text, label, numbering):
- # type: (str, str, bool) -> str
- def is_equation(part):
- # type: (str) -> str
+def wrap_displaymath(text: str, label: str, numbering: bool) -> str:
+ def is_equation(part: str) -> str:
return part.strip()
if label is None: