summaryrefslogtreecommitdiff
path: root/sphinx/directives
diff options
context:
space:
mode:
authorViktor Haag <Viktor.Haag@D2L.com>2019-06-14 08:02:24 -0400
committerViktor Haag <Viktor.Haag@D2L.com>2019-06-14 08:02:24 -0400
commitd19dd1c8dec8cc80229e8314cdbc37650b366eaf (patch)
tree2fc13cb4d14bc372908c2e67d2a2ab9ff6730971 /sphinx/directives
parent085ae2e08187acc5dfdff7e79364e5962afc121c (diff)
downloadsphinx-git-d19dd1c8dec8cc80229e8314cdbc37650b366eaf.tar.gz
mypy type annotations for methods added
- type annotation for _process_type_map was incorrect; needed to document the positional argument for the method - __init__ method for ObjectDescription missing type annotation, so added
Diffstat (limited to 'sphinx/directives')
-rw-r--r--sphinx/directives/__init__.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/sphinx/directives/__init__.py b/sphinx/directives/__init__.py
index 72ab221d2..3eb3866f4 100644
--- a/sphinx/directives/__init__.py
+++ b/sphinx/directives/__init__.py
@@ -71,7 +71,7 @@ class ObjectDescription(SphinxDirective):
_doc_field_type_map = {} # type: Dict[str, Tuple[Field, bool]]
def _process_type_map(self, typelist):
- # type: () -> Dict[str, Tuple[Field, bool]]
+ # type: (List[Field]) -> Dict[str, Tuple[Field, bool]]
typemap = {}
for field in typelist:
for name in field.names:
@@ -83,6 +83,7 @@ class ObjectDescription(SphinxDirective):
return typemap
def __init__(self, *args, **kwargs):
+ # type: (*Any, **Any) -> None
SphinxDirective.__init__(self, *args, **kwargs)
self._doc_field_type_map = self._process_type_map(self.doc_field_types)