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(),