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.
1 parent c7ece62 commit 8c4750aCopy full SHA for 8c4750a
pylint/checkers/base/basic_error_checker.py
@@ -20,7 +20,7 @@
20
ABC_METACLASSES = {"_py_abc.ABCMeta", "abc.ABCMeta"} # Python 3.7+,
21
# List of methods which can be redefined
22
REDEFINABLE_METHODS = frozenset(("__module__",))
23
-TYPING_FORWARD_REF_QNAME = "typing.ForwardRef"
+FORWARD_REF_QNAME = {"typing.ForwardRef", "annotationlib.ForwardRef"}
24
25
26
def _get_break_loop_node(break_node: nodes.Break) -> nodes.For | nodes.While | None:
@@ -575,7 +575,7 @@ def _check_redefinition(
575
if (
576
inferred
577
and isinstance(inferred, astroid.Instance)
578
- and inferred.qname() == TYPING_FORWARD_REF_QNAME
+ and inferred.qname() in FORWARD_REF_QNAME
579
):
580
return
581
0 commit comments