-
Notifications
You must be signed in to change notification settings - Fork 57
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
[R-package] Use keyword arguments with internal constructor calls #244
Comments
I think it's good idea! ping @mlampros |
@jameslamb would you mind give an example with explicit keyword arguments for this specific code snippet. thanks. |
yes sorry! Should have given an example.
I am proposing changing it to this:
Without keyword args, a PR that flipped the order of So basically the keyword idea is a free protection against the small possibility of something like my example above happening. |
@jameslamb you are right. You can proceed with the PR. |
ok! will do |
The classes in the R package all include calls that look similar to this:
That is 15 positional arguments. In my humble opinion, using this many positional arguments raises the risk of subtle and silent failures. I think explicit keyword arguments should be used in those calls. That will catch problems and have the side benefit of failing loudly in CI if the API for e.g.
RGFRegressor
changes.The text was updated successfully, but these errors were encountered: