MCPcopy Create free account
hub / github.com/datacamp/pythonwhat / visit_Call

Method visit_Call

pythonwhat/parsing.py:326–352  ·  view source on GitHub ↗
(self, node)

Source from the content-addressed store, hash-verified

324 [self.visit(el) for el in node.values]
325
326 def visit_Call(self, node):
327 if self.call_lookup_active:
328 self.visit(node.func)
329 else:
330 self.call_lookup_active = True
331 self.visit(
332 node.func
333 ) # Need to visit func to start recording the current function name.
334
335 if self.gen_name:
336 if self.gen_name not in self.out:
337 self.out[self.gen_name] = []
338
339 self.out[self.gen_name].append(self.get_call_part(node))
340 # self.out[self.current].append((node, node.args, node.keywords))
341
342 self.gen_name = self.raw_name = ""
343 self.call_lookup_active = False
344
345 # dive deeper in func, args and keywords
346 self.visit(node.func)
347
348 for arg in node.args:
349 self.visit(arg)
350
351 for key in node.keywords:
352 self.visit(key.value)
353
354 def visit_Attribute(self, node):
355 self.visit(node.value) # Go deeper for the package/module names!

Callers

nothing calls this directly

Calls 1

get_call_partMethod · 0.95

Tested by

no test coverage detected