Method: pylint.checkers.logging.is_method_call
Calls: 9, Exceptions: 0, Paths: 1Back
Path 1: 9 calls (1.0)
BoundMethod (9)
('str', 'unicode') (9)
('format',) (9)
True (8) False (1)
1def is_method_call(
2 func: bases.BoundMethod, types: tuple[str, ...] = (), methods: tuple[str, ...] = ()
3) -> bool:
4 """Determines if a BoundMethod node represents a method call.
5
6 Args:
7 func: The BoundMethod AST node to check.
8 types: Optional sequence of caller type names to restrict check.
9 methods: Optional sequence of method names to restrict check.
10
11 Returns:
12 true if the node represents a method call for the given type and
13 method names, False otherwise.
14 """
15 return (
16 isinstance(func, astroid.BoundMethod)
17 and isinstance(func.bound, astroid.Instance)
18 and (func.bound.name in types if types else True)
19 and (func.name in methods if methods else True)
20 )