Method: pylint.checkers.utils.is_registered_in_singledispatchmethod_function
Calls: 89, Exceptions: 0, Paths: 2Back
Path 1: 85 calls (0.96)
FunctionDef (85)
False (85)
1def is_registered_in_singledispatchmethod_function(node: nodes.FunctionDef) -> bool:
2 """Check if the given function node is a singledispatchmethod function."""
3
4 singledispatchmethod_qnames = (
5 "functools.singledispatchmethod",
6 "singledispatch.singledispatchmethod",
7 )
8
9 decorators = node.decorators.nodes if node.decorators else []
10 for decorator in decorators:
11 func_def = find_inferred_fn_from_register(decorator)
12 if func_def:
13 return decorated_with(func_def, singledispatchmethod_qnames)
14
15 return False
Path 2: 4 calls (0.04)
FunctionDef (4)
True (4)
1def is_registered_in_singledispatchmethod_function(node: nodes.FunctionDef) -> bool:
2 """Check if the given function node is a singledispatchmethod function."""
3
4 singledispatchmethod_qnames = (
5 "functools.singledispatchmethod",
6 "singledispatch.singledispatchmethod",
7 )
8
9 decorators = node.decorators.nodes if node.decorators else []
10 for decorator in decorators:
11 func_def = find_inferred_fn_from_register(decorator)
12 if func_def:
13 return decorated_with(func_def, singledispatchmethod_qnames)
14
15 return False