Merge pull request #9118 from chrisjsewell/fix-typing

🐛 FIX: `Config.__getitem__` typing
This commit is contained in:
Takeshi KOMIYA 2021-04-24 17:37:40 +09:00 committed by GitHub
commit e21e18441f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -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:

View File

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