bazelbuild / bazelbuild/starlark

Permit multiple **kwargs arguments

Open
#178 3 comments 5 reactions 0 assignees View on GitHub
P4 type: feature request
Dominant language
Python
Stars
3.1k
Forks
178
PR merge metrics
No merged PRs in 30d

Description

Given the function call `f(**a, **b)` the meaning is clear and precise. But the best Starlark-compliant alternative I could find is:

```
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.

Contributor guide

Open the contributing guide

Research direction

The issue proposes allowing multiple **kwargs arguments in a Starlark call and raises the possibility of allowing multiple *args arguments too. Start by reviewing the language's call-argument handling and existing duplicate-key behavior; define the semantics and test cases before implementation. Done means the proposal is resolved, specified, and covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.