summaryrefslogtreecommitdiff
path: root/sphinx/environment/adapters/indexentries.py
diff options
context:
space:
mode:
authordanieleades <33452915+danieleades@users.noreply.github.com>2022-07-18 22:08:16 +0100
committerGitHub <noreply@github.com>2022-07-18 22:08:16 +0100
commita504ac6100a577cbda1bedf80d69636603ee287c (patch)
tree0aa79585440486bdb109f7238f8f5c992dad0d99 /sphinx/environment/adapters/indexentries.py
parenta340427ba4d208193d539cb7e8401be23d75547e (diff)
downloadsphinx-git-a504ac6100a577cbda1bedf80d69636603ee287c.tar.gz
Improve static typing strictness (#10569)
Diffstat (limited to 'sphinx/environment/adapters/indexentries.py')
-rw-r--r--sphinx/environment/adapters/indexentries.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/sphinx/environment/adapters/indexentries.py b/sphinx/environment/adapters/indexentries.py
index 49881b76d..364331286 100644
--- a/sphinx/environment/adapters/indexentries.py
+++ b/sphinx/environment/adapters/indexentries.py
@@ -3,7 +3,7 @@
import re
import unicodedata
from itertools import groupby
-from typing import Any, Dict, List, Pattern, Tuple, cast
+from typing import Any, Dict, List, Optional, Pattern, Tuple, cast
from sphinx.builders import Builder
from sphinx.domains.index import IndexDomain
@@ -26,7 +26,7 @@ class IndexEntries:
new: Dict[str, List] = {}
def add_entry(word: str, subword: str, main: str, link: bool = True,
- dic: Dict = new, key: str = None) -> None:
+ dic: Dict[str, List] = new, key: Optional[str] = None) -> None:
# Force the word to be unicode if it's a ASCII bytestring.
# This will solve problems with unicode normalization later.
# For instance the RFC role will add bytestrings at the moment
@@ -118,7 +118,7 @@ class IndexEntries:
# (in module foo)
# (in module bar)
oldkey = ''
- oldsubitems: Dict[str, List] = None
+ oldsubitems: Optional[Dict[str, List]] = None
i = 0
while i < len(newlist):
key, (targets, subitems, _key) = newlist[i]