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:
-rw-r--r--setup.py2
-rw-r--r--sphinx/domains/std.py9
-rw-r--r--sphinx/util/inspect.py2
-rw-r--r--sphinx/util/stemmer/__init__.py2
-rw-r--r--sphinx/writers/latex.py2
-rw-r--r--sphinx/writers/texinfo.py2
-rw-r--r--sphinx/writers/text.py2
7 files changed, 11 insertions, 10 deletions
diff --git a/setup.py b/setup.py
index 91b3e12cc..2b6e25713 100644
--- a/setup.py
+++ b/setup.py
@@ -47,7 +47,7 @@ extras_require = {
'html5lib',
'flake8>=3.5.0',
'flake8-import-order',
- 'mypy>=0.590',
+ 'mypy>=0.710',
'docutils-stubs',
],
}
diff --git a/sphinx/domains/std.py b/sphinx/domains/std.py
index 01cc797c3..45516ebd9 100644
--- a/sphinx/domains/std.py
+++ b/sphinx/domains/std.py
@@ -910,12 +910,13 @@ class StandardDomain(Domain):
# type: (nodes.Node) -> str
"""Get the title of enumerable nodes to refer them using its title"""
if self.is_enumerable_node(node):
- _, title_getter = self.enumerable_nodes.get(node.__class__, (None, None))
+ elem = cast(nodes.Element, node)
+ _, title_getter = self.enumerable_nodes.get(elem.__class__, (None, None))
if title_getter:
- return title_getter(node)
+ return title_getter(elem)
else:
- for subnode in node:
- if subnode.tagname in ('caption', 'title'):
+ for subnode in elem:
+ if isinstance(subnode, (nodes.caption, nodes.title)):
return clean_astext(subnode)
return None
diff --git a/sphinx/util/inspect.py b/sphinx/util/inspect.py
index 42530eb40..c49708242 100644
--- a/sphinx/util/inspect.py
+++ b/sphinx/util/inspect.py
@@ -129,7 +129,7 @@ def isenumattribute(x):
def ispartial(obj):
# type: (Any) -> bool
"""Check if the object is partial."""
- return isinstance(obj, (partial, partialmethod))
+ return isinstance(obj, (partial, partialmethod)) # type: ignore
def isclassmethod(obj):
diff --git a/sphinx/util/stemmer/__init__.py b/sphinx/util/stemmer/__init__.py
index 047aac708..b9fb5c252 100644
--- a/sphinx/util/stemmer/__init__.py
+++ b/sphinx/util/stemmer/__init__.py
@@ -33,7 +33,7 @@ class PyStemmer(BaseStemmer):
return self.stemmer.stemWord(word)
-class StandardStemmer(PorterStemmer, BaseStemmer): # type: ignore
+class StandardStemmer(PorterStemmer, BaseStemmer):
"""All those porter stemmer implementations look hideous;
make at least the stem method nicer.
"""
diff --git a/sphinx/writers/latex.py b/sphinx/writers/latex.py
index 5c7f52507..24ec059e5 100644
--- a/sphinx/writers/latex.py
+++ b/sphinx/writers/latex.py
@@ -2598,7 +2598,7 @@ class LaTeXTranslator(SphinxTranslator):
RemovedInSphinx30Warning)
def visit_admonition(self, node):
- # type: (nodes.Element) -> None
+ # type: (LaTeXTranslator, nodes.Element) -> None
self.body.append('\n\\begin{sphinxadmonition}{%s}{%s:}' %
(name, admonitionlabels[name]))
return visit_admonition
diff --git a/sphinx/writers/texinfo.py b/sphinx/writers/texinfo.py
index 4262ccd66..b952812f0 100644
--- a/sphinx/writers/texinfo.py
+++ b/sphinx/writers/texinfo.py
@@ -1752,6 +1752,6 @@ class TexinfoTranslator(SphinxTranslator):
RemovedInSphinx30Warning)
def visit(self, node):
- # type: (nodes.Element) -> None
+ # type: (TexinfoTranslator, nodes.Element) -> None
self.visit_admonition(node, admonitionlabels[name])
return visit
diff --git a/sphinx/writers/text.py b/sphinx/writers/text.py
index 1447510c3..dc8a7963a 100644
--- a/sphinx/writers/text.py
+++ b/sphinx/writers/text.py
@@ -1375,6 +1375,6 @@ class TextTranslator(SphinxTranslator):
RemovedInSphinx30Warning)
def depart_admonition(self, node):
- # type: (nodes.Element) -> None
+ # type: (TextTranslator, nodes.Element) -> None
self.end_state(first=admonitionlabels[name] + ': ')
return depart_admonition