Method: pylint.checkers.variables.NamesConsumer.mark_as_consumed
Calls: 6509, Exceptions: 0, Paths: 2Back
Path 1: 6502 calls (1.0)
'self' (641) 'x' (242) 'i' (134) 'value' (124) 'arg' (100) 'args' (94) 'var' (84) 'first' (80) 'y' (80) 'a' (78)
list (6502)
1def mark_as_consumed(self, name: str, consumed_nodes: list[nodes.NodeNG]) -> None:
2 """Mark the given nodes as consumed for the name.
3
4 If all of the nodes for the name were consumed, delete the name from
5 the to_consume dictionary
6 """
7 unconsumed = [n for n in self.to_consume[name] if n not in set(consumed_nodes)]
8 self.consumed[name] = consumed_nodes
9
10 if unconsumed:
11 self.to_consume[name] = unconsumed
12 else:
13 del self.to_consume[name]
Path 2: 7 calls (0.0)
'e' (4) 'exc' (1) 'err' (1) 'error' (1)
list (7)
1def mark_as_consumed(self, name: str, consumed_nodes: list[nodes.NodeNG]) -> None:
2 """Mark the given nodes as consumed for the name.
3
4 If all of the nodes for the name were consumed, delete the name from
5 the to_consume dictionary
6 """
7 unconsumed = [n for n in self.to_consume[name] if n not in set(consumed_nodes)]
8 self.consumed[name] = consumed_nodes
9
10 if unconsumed:
11 self.to_consume[name] = unconsumed
12 else:
13 del self.to_consume[name]