Closed bartekpacia closed 6 months ago
I could not find information about starred expressions neither in Java spec nor in Go spec.
I propose this behavior to be documented in both specs.
def func(arg, *args, **kwargs): print("arg: %s, type: %s" % (arg, type(arg))) print("args: %s, type: %s" % (args, type(args))) print("kwargs: %s, type: %s" % (kwargs, type(kwargs))) arg = "a" args = ["b", "c"] kwargs = {"d": 4, "e": 5} print("\n--- NOT using starred expressions ---\n") func(arg, args, kwargs) print("\n--- Using starred expressions ---\n") func(arg, *args, **kwargs)
$ starlark main.star --- NOT using starred expressions --- arg: a, type: string args: (["b", "c"], {"d": 4, "e": 5}), type: tuple kwargs: {}, type: dict --- Using starred expressions --- arg: a, type: string args: ("b", "c"), type: tuple kwargs: {"d": 4, "e": 5}, type: dict
I didn't search well enough – it is documented:
Description
I could not find information about starred expressions neither in Java spec nor in Go spec.
I propose this behavior to be documented in both specs.
Code snippet
Behavior