Open ndmitchell opened 3 years ago
Given the function call f(**a, **b) the meaning is clear and precise. But the best Starlark-compliant alternative I could find is:
f(**a, **b)
x = dict(a) a.update(b) f(**x)
That seems more complex, and it's easy to get it wrong, and it doesn't error if a key is repeated (unlike before).
Given an extension to multiple **kwargs, I see no reason not to allow it for *args too, although there the argument is weaker.
**kwargs
*args
We could instead support the python3 {**a, **b} syntax for constructing/merging dicts, which would make your call instead look like:
{**a, **b}
f(**{**a, **b})
which is valid python3.
Yep, that would be great too.
Given the function call
f(**a, **b)
the meaning is clear and precise. But the best Starlark-compliant alternative I could find is:That seems more complex, and it's easy to get it wrong, and it doesn't error if a key is repeated (unlike before).
Given an extension to multiple
**kwargs
, I see no reason not to allow it for*args
too, although there the argument is weaker.