mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #9118 from chrisjsewell/fix-typing
🐛 FIX: `Config.__getitem__` typing
This commit is contained in:
commit
e21e18441f
@ -255,7 +255,7 @@ class Config:
|
|||||||
return default(self)
|
return default(self)
|
||||||
return default
|
return default
|
||||||
|
|
||||||
def __getitem__(self, name: str) -> str:
|
def __getitem__(self, name: str) -> Any:
|
||||||
return getattr(self, name)
|
return getattr(self, name)
|
||||||
|
|
||||||
def __setitem__(self, name: str, value: Any) -> None:
|
def __setitem__(self, name: str, value: Any) -> None:
|
||||||
|
@ -1023,7 +1023,7 @@ class PythonModuleIndex(Index):
|
|||||||
) -> Tuple[List[Tuple[str, List[IndexEntry]]], bool]:
|
) -> Tuple[List[Tuple[str, List[IndexEntry]]], bool]:
|
||||||
content: Dict[str, List[IndexEntry]] = {}
|
content: Dict[str, List[IndexEntry]] = {}
|
||||||
# list of prefixes to ignore
|
# 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)
|
ignores = sorted(ignores, key=len, reverse=True)
|
||||||
# list of all modules, sorted by module name
|
# list of all modules, sorted by module name
|
||||||
modules = sorted(self.domain.data['modules'].items(),
|
modules = sorted(self.domain.data['modules'].items(),
|
||||||
|
Loading…
Reference in New Issue
Block a user