Method: pylint.extensions.typing.TypingChecker._check_broken_callable
Calls: 39, Exceptions: 0, Paths: 3Back
Path 1: 19 calls (0.49)
Name (19)
None (19)
1def _check_broken_callable(self, node: nodes.Name | nodes.Attribute) -> None:
2 """Check for 'collections.abc.Callable' inside Optional and Union."""
3 inferred = safe_infer(node)
4 if not (
5 isinstance(inferred, nodes.ClassDef)
6 and inferred.qname() == "_collections_abc.Callable"
7 and self._broken_callable_location(node)
8 ):
9 return
10
11 self.add_message("broken-collections-callable", node=node, confidence=INFERENCE)
Path 2: 14 calls (0.36)
Name (10) Attribute (4)
None (14)
1def _check_broken_callable(self, node: nodes.Name | nodes.Attribute) -> None:
2 """Check for 'collections.abc.Callable' inside Optional and Union."""
3 inferred = safe_infer(node)
4 if not (
5 isinstance(inferred, nodes.ClassDef)
6 and inferred.qname() == "_collections_abc.Callable"
7 and self._broken_callable_location(node)
8 ):
9 return
10
11 self.add_message("broken-collections-callable", node=node, confidence=INFERENCE)
Path 3: 6 calls (0.15)
Name (5) Attribute (1)
1def _check_broken_callable(self, node: nodes.Name | nodes.Attribute) -> None:
2 """Check for 'collections.abc.Callable' inside Optional and Union."""
3 inferred = safe_infer(node)
4 if not (
5 isinstance(inferred, nodes.ClassDef)
6 and inferred.qname() == "_collections_abc.Callable"
7 and self._broken_callable_location(node)
8 ):
9 return
10
11 self.add_message("broken-collections-callable", node=node, confidence=INFERENCE)