diff options
| author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2021-04-24 17:37:40 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-04-24 17:37:40 +0900 |
| commit | e21e18441fceefdcd64e52d6686100d7e1323664 (patch) | |
| tree | 6eff597007126dee6e4275b39ed9d1c3e665edb4 | |
| parent | 5e1e747e8f3ac85b27947ca92d9e796f4b489908 (diff) | |
| parent | 9019144590fe1ad056d417f8a3f814890a68ecda (diff) | |
| download | sphinx-git-e21e18441fceefdcd64e52d6686100d7e1323664.tar.gz | |
Merge pull request #9118 from chrisjsewell/fix-typing
🐛 FIX: `Config.__getitem__` typing
| -rw-r--r-- | sphinx/config.py | 2 | ||||
| -rw-r--r-- | sphinx/domains/python.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/sphinx/config.py b/sphinx/config.py index a9fdddc8a..418ecf4fb 100644 --- a/sphinx/config.py +++ b/sphinx/config.py @@ -255,7 +255,7 @@ class Config: return default(self) return default - def __getitem__(self, name: str) -> str: + def __getitem__(self, name: str) -> Any: return getattr(self, name) def __setitem__(self, name: str, value: Any) -> None: diff --git a/sphinx/domains/python.py b/sphinx/domains/python.py index fb8a4d84f..4464895ef 100644 --- a/sphinx/domains/python.py +++ b/sphinx/domains/python.py @@ -1023,7 +1023,7 @@ class PythonModuleIndex(Index): ) -> Tuple[List[Tuple[str, List[IndexEntry]]], bool]: content: Dict[str, List[IndexEntry]] = {} # list of prefixes to ignore - ignores: List[str] = self.domain.env.config['modindex_common_prefix'] # type: ignore + ignores: List[str] = self.domain.env.config['modindex_common_prefix'] ignores = sorted(ignores, key=len, reverse=True) # list of all modules, sorted by module name modules = sorted(self.domain.data['modules'].items(), |
