From b048f17cda17322b0f3580ac75796265074eb8c9 Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Sat, 30 Apr 2022 22:13:40 +0900 Subject: [PATCH] Fix mypy violations (with mypy-0.950) --- setup.py | 2 +- sphinx/domains/python.py | 2 +- sphinx/locale/__init__.py | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/setup.py b/setup.py index ccadd59f4d3..edf19ce1ddd 100644 --- a/setup.py +++ b/setup.py @@ -43,7 +43,7 @@ 'lint': [ 'flake8>=3.5.0', 'isort', - 'mypy>=0.931', + 'mypy>=0.950', 'docutils-stubs', "types-typed-ast", "types-requests", diff --git a/sphinx/domains/python.py b/sphinx/domains/python.py index f55d76ba094..98162f6995c 100644 --- a/sphinx/domains/python.py +++ b/sphinx/domains/python.py @@ -1466,7 +1466,7 @@ def istyping(s: str) -> bool: if s.startswith('typing.'): s = s.split('.', 1)[1] - return s in typing.__all__ # type: ignore + return s in typing.__all__ if node.get('refdomain') != 'py': return None diff --git a/sphinx/locale/__init__.py b/sphinx/locale/__init__.py index b9bdff0f9c7..ae320054a69 100644 --- a/sphinx/locale/__init__.py +++ b/sphinx/locale/__init__.py @@ -59,19 +59,19 @@ def __str__(self) -> str: def __add__(self, other: str) -> str: # type: ignore return self.data + other - def __radd__(self, other: str) -> str: + def __radd__(self, other: str) -> str: # type: ignore return other + self.data def __mod__(self, other: str) -> str: # type: ignore return self.data % other - def __rmod__(self, other: str) -> str: + def __rmod__(self, other: str) -> str: # type: ignore return other % self.data def __mul__(self, other: Any) -> str: # type: ignore return self.data * other - def __rmul__(self, other: Any) -> str: + def __rmul__(self, other: Any) -> str: # type: ignore return other * self.data def __getattr__(self, name: str) -> Any: