diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2019-06-02 17:19:53 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2019-06-02 17:51:20 +0900 |
commit | 850bfa07d278fca79965c0fc5c44116e36062ffc (patch) | |
tree | a2b941341196a71555e771c267cb52ea8f536164 /sphinx/util/docstrings.py | |
parent | afbf6d811dd4fc514d63e9dc3d6bee78d97b8a0c (diff) | |
download | sphinx-git-850bfa07d278fca79965c0fc5c44116e36062ffc.tar.gz |
Migrate to py3 style type annotation: sphinx.util.docstrings
Diffstat (limited to 'sphinx/util/docstrings.py')
-rw-r--r-- | sphinx/util/docstrings.py | 11 |
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. """ |