diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2021-05-03 23:17:30 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2021-05-10 02:01:24 +0900 |
commit | 2ee634bfdada724bccd56b372670538f2f20b3bc (patch) | |
tree | 8e25b41d538d5114a11d24810ba8d23dd4a55826 /sphinx/pycode/__init__.py | |
parent | b88187de34815977bb6f282f3cce7c2cd936e6a6 (diff) | |
download | sphinx-git-2ee634bfdada724bccd56b372670538f2f20b3bc.tar.gz |
refactor: Add Optional to type annotations
Diffstat (limited to 'sphinx/pycode/__init__.py')
-rw-r--r-- | sphinx/pycode/__init__.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sphinx/pycode/__init__.py b/sphinx/pycode/__init__.py index c55a4fe4a..8e79385e2 100644 --- a/sphinx/pycode/__init__.py +++ b/sphinx/pycode/__init__.py @@ -25,6 +25,13 @@ from sphinx.pycode.parser import Parser class ModuleAnalyzer: + annotations: Dict[Tuple[str, str], str] + attr_docs: Dict[Tuple[str, str], List[str]] + finals: List[str] + overloads: Dict[str, List[Signature]] + tagorder: Dict[str, int] + tags: Dict[str, Tuple[str, int, int]] + # cache for analyzer objects -- caches both by module and file name cache: Dict[Tuple[str, str], Any] = {} @@ -134,13 +141,6 @@ class ModuleAnalyzer: # cache the source code as well self.code = source.read() - # will be filled by analyze() - self.annotations: Dict[Tuple[str, str], str] = None - self.attr_docs: Dict[Tuple[str, str], List[str]] = None - self.finals: List[str] = None - self.overloads: Dict[str, List[Signature]] = None - self.tagorder: Dict[str, int] = None - self.tags: Dict[str, Tuple[str, int, int]] = None self._analyzed = False def parse(self) -> None: |