Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spec: statically reject repeated keyword arguments in call #21

Closed
alandonovan opened this issue Dec 12, 2018 · 3 comments · Fixed by #133
Closed

spec: statically reject repeated keyword arguments in call #21

alandonovan opened this issue Dec 12, 2018 · 3 comments · Fixed by #133

Comments

@alandonovan
Copy link
Contributor

I notice that both Python2 and Python3 statically reject repeated keyword arguments in a call:

% python2 -c 'if False: f(a=1, a=1)'
  File "<string>", line 1
SyntaxError: keyword argument repeated
% python3 -c 'if False: f(a=1, a=1)'
  File "<string>", line 1
SyntaxError: keyword argument repeated

Perhaps Starlark should also. Neither the Go nor Java implementation currently does.

(Note: this issue is independent of the question of whether repeated arguments are checked dynamically when a **kwargs is present in the call.)

@laurentlb
Copy link
Contributor

Agree, I think we should do it.

alandonovan pushed a commit to google/starlark-go that referenced this issue Dec 14, 2018
This complements the dynamic checks, which is already implemented
in setArgs and in UnpackeArgs.

Updates bazelbuild/starlark#21

Change-Id: If18c9b1f228149b67eca9637050e76e94bd9ff85
alandonovan pushed a commit to google/starlark-go that referenced this issue Dec 14, 2018
This complements the dynamic checks, which is already implemented in setArgs and in UnpackArgs.

Updates bazelbuild/starlark#21
@alandonovan
Copy link
Contributor Author

OK, this is implemented, tested, and documented in Go.

adonovan added a commit to adonovan/starlark-spec-fork that referenced this issue Nov 13, 2020
This wording comes from google/starlark-go@2c65f9e

Fixes bazelbuild#21

Change-Id: I545111904f25fc0764633f55c5f887706123b0bc
@alandonovan
Copy link
Contributor Author

The Java code change was bazelbuild/bazel@9f72d7e

adonovan added a commit to adonovan/starlark-spec-fork that referenced this issue Dec 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants