We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
refers_to_fullname
1 parent 7031574 commit f59720dCopy full SHA for f59720d
mypy/checker.py
@@ -5020,8 +5020,9 @@ def visit_if_stmt(self, s: IfStmt) -> None:
5020
if_map, else_map = self.find_isinstance_check(e)
5021
5022
if codes.REDUNDANT_EXPR in self.options.enabled_error_codes and not (
5023
- isinstance(e, NameExpr)
5024
- and e.fullname in ("typing.TYPE_CHECKING", "typing_extensions.TYPE_CHECKING")
+ refers_to_fullname(
+ e, ("typing.TYPE_CHECKING", "typing_extensions.TYPE_CHECKING")
5025
+ )
5026
):
5027
if if_map is None:
5028
if s.while_stmt:
0 commit comments