diff options
| author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-02-01 13:38:31 +0900 |
|---|---|---|
| committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-02-03 01:16:21 +0900 |
| commit | 2ed26b437744da564e456ed2adc8d50eee3b5166 (patch) | |
| tree | ee19d4910490dde37b3d91bdf38256df5f7c539a /sphinx/pycode/__init__.py | |
| parent | 5e4e44c19598aaeeda15422422cf5eec8136a9ea (diff) | |
| download | sphinx-git-2ed26b437744da564e456ed2adc8d50eee3b5166.tar.gz | |
pycode: Support type annotations for variables
Diffstat (limited to 'sphinx/pycode/__init__.py')
| -rw-r--r-- | sphinx/pycode/__init__.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sphinx/pycode/__init__.py b/sphinx/pycode/__init__.py index 12bd8d9ef..55d5d2c1d 100644 --- a/sphinx/pycode/__init__.py +++ b/sphinx/pycode/__init__.py @@ -142,9 +142,10 @@ class ModuleAnalyzer: self.code = source.read() # will be filled by parse() - self.attr_docs = None # type: Dict[Tuple[str, str], List[str]] - self.tagorder = None # type: Dict[str, int] - self.tags = None # type: Dict[str, Tuple[str, int, int]] + self.annotations = None # type: Dict[Tuple[str, str], str] + self.attr_docs = None # type: Dict[Tuple[str, str], List[str]] + self.tagorder = None # type: Dict[str, int] + self.tags = None # type: Dict[str, Tuple[str, int, int]] def parse(self) -> None: """Parse the source code.""" @@ -159,6 +160,7 @@ class ModuleAnalyzer: else: self.attr_docs[scope] = [''] + self.annotations = parser.annotations self.tags = parser.definitions self.tagorder = parser.deforders except Exception as exc: |
