summaryrefslogtreecommitdiff
path: root/sphinx/util/docstrings.py
diff options
context:
space:
mode:
Diffstat (limited to 'sphinx/util/docstrings.py')
-rw-r--r--sphinx/util/docstrings.py11
1 files changed, 3 insertions, 8 deletions
diff --git a/sphinx/util/docstrings.py b/sphinx/util/docstrings.py
index 31943b2cb..c2fe17004 100644
--- a/sphinx/util/docstrings.py
+++ b/sphinx/util/docstrings.py
@@ -9,14 +9,10 @@
"""
import sys
+from typing import List
-if False:
- # For type annotation
- from typing import List # NOQA
-
-def prepare_docstring(s, ignore=1, tabsize=8):
- # type: (str, int, int) -> List[str]
+def prepare_docstring(s: str, ignore: int = 1, tabsize: int = 8) -> List[str]:
"""Convert a docstring into lines of parseable reST. Remove common leading
indentation, where the indentation of a given number of lines (usually just
one) is ignored.
@@ -49,8 +45,7 @@ def prepare_docstring(s, ignore=1, tabsize=8):
return lines
-def prepare_commentdoc(s):
- # type: (str) -> List[str]
+def prepare_commentdoc(s: str) -> List[str]:
"""Extract documentation comment lines (starting with #:) and return them
as a list of lines. Returns an empty list if there is no documentation.
"""