-
Notifications
You must be signed in to change notification settings - Fork 765
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
Discuss/Consider using all named arguments #1831
Comments
I am not able to read that Slack post. Maybe it was in private? However: Why did we (RF Browser) switch from pos_or_named arguments to named_only arguments on import and some keywords?Browser library has some keyword that have a massive amount of arguments. Also the library init has 13 arguments or so. 1. This is too much to use it positionallycalling these with positional arguments, the reader of this code would have no clue of which argument is what. 2. These arguments do not have any distinct order.They are not related to each other. see also Click compared to new Click With Options 3. unordered positional arguments are harder to read and understand.because there is no meaningful oder it is harder to find the correct argument. 4. positional arguments are hard to maintain or extend.extending an argument interface of positional arguments always mean, to add new ones to the end and never get rid of any of those before. It is impossible to really deprecate an argument, because there is no way user may do the transition from one amount to another amount without breaking it. Exception is, that users use named arguments. then the order is irrelevant. So named arguments are easy to extend and still keep a good shape/readability. How did we do the transition?It was in my opinion a smart and effective solution.
therefore you can maintain backwards compatibility and still log a deprecation warning. |
Coming from discussions [1] around combining all timeout library arguments and some changes done within the core and used by the browser library there is a thought/proposal to use all named arguments as compared to both named and positional ones within the library import.
[At the moment, this is more of a placeholder then a full description as I myself am still understanding the issue/proposal. But as a way to have an open discussion we want to place this here so we can start to describe, understand and discuss possibilities around this topic.]
[1] https://robotframework.slack.com/archives/C051AB7MFEH/p1681256514114099
The text was updated successfully, but these errors were encountered: