-
Notifications
You must be signed in to change notification settings - Fork 124
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
Raise error on unknown options #147
Comments
Would be nice to switch this to kwargs. Do investigate a PR. |
I quickly looked into this, but this change is not possible without changing API. The reason is that all unknown options are converted to params, so for the example above this would yield: This could be made explicit by requiring users to pass params explicitly (eg. |
Doesn't |
Ah sure, switching to kwargs is still possible (and may be worthwhile), but wouldn't fix the problem I originally ran into - namely that someone tried to change the purpose using the wrong keyword (ie. |
oh, right. Yeah, I'm not sure it is worth the effort to have a deprecation cycle. |
Just to clarify, are you saying "let's do the change, but not have a deprecation cycle" or "let's not do the change"? |
I'm not sure if doing the change is worth. The new API would be worse for the most common use case. Sure, it means that people will sometimes make mistakes in the call, but that is why we recommend to write tests. |
We just caught the following during code review:
The correct option to pass is
for
instead ofpurpose
. This went unnoticed because everything still works, but thedefault
purpose is used.Maybe it would make sense to raise an error in case an unknown option is passed to
to_sgid
(and friends)?The text was updated successfully, but these errors were encountered: