MCPcopy
hub / github.com/rocky/python-uncompyle6 / call_ex_kw4

Function call_ex_kw4

uncompyle6/semantics/customize36.py:338–374  ·  view source on GitHub ↗

Handle CALL_FUNCTION_EX {1 or 2} but without BUILD_{MAP,TUPLE}_UNPACK_WITH_CALL

(node)

Source from the content-addressed store, hash-verified

336 self.n_call_ex_kw3 = call_ex_kw3
337
338 def call_ex_kw4(node):
339 """Handle CALL_FUNCTION_EX {1 or 2} but without
340 BUILD_{MAP,TUPLE}_UNPACK_WITH_CALL"""
341 self.preorder(node[0])
342 self.write("(")
343 args = node[1][0]
344 if args == "tuple":
345 if self.call36_tuple(args) > 0:
346 self.write(", ")
347 pass
348 pass
349 else:
350 self.write("*")
351 self.preorder(args)
352 self.write(", ")
353 pass
354
355 kwargs = node[2]
356 if kwargs == "expr":
357 kwargs = kwargs[0]
358 call_function_ex = node[-1]
359 assert call_function_ex == "CALL_FUNCTION_EX_KW" or (
360 self.version >= (3, 6) and call_function_ex == "CALL_FUNCTION_EX"
361 )
362 # FIXME: decide if the below test be on kwargs == 'dict'
363 if (
364 call_function_ex.attr & 1
365 and (not isinstance(kwargs, Token) and kwargs != "attribute")
366 and kwargs != "call_kw36"
367 and not kwargs[0].kind.startswith("kvlist")
368 ):
369 self.call36_dict(kwargs)
370 else:
371 self.write("**")
372 self.preorder(kwargs)
373 self.write(")")
374 self.prune()
375
376 self.n_call_ex_kw4 = call_ex_kw4
377

Callers

nothing calls this directly

Calls 2

preorderMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected