You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support named-only arguments with user keywords #2896
Issue #2555 adds support for named-only arguments, or keyword-only arguments if we use Python terminology, when using Python based keywords. This functionality would be useful also with user keywords and having consistent feature set among different keywords is important as well.
For most part we can design this functionality based on how it works with Python. In practice this means that we could have keywords like this
that would require passing the argument after varargs using the named-arguments syntax like named=value.
The only real question is how to specify that named-only arguments are used when there are no varargs. Python uses a lone * for that, and I propose we use @{} similarly. Alternatively we could use just @, but somehow I feel the former better. For example, the following keyword would accept no positional arguments and would require the named-only argument passed like named=value.
I kind of like @ better than @{} as well, but when used with other arguments @ looks a bit weird. For example, the example above with @{} ${named} looks somehow better to me than @ ${named}. A problem with the latter is that Robot syntax highlighter here on GitHub doesn't recognize @ as an argument and, for example, PyCharm works the same. These can be fixed eventually, but @{} working out-of-the box is nice.
Activity
Support named-only arguments with user keywords.
Cleanup code related to named-only args with user keywords
pekkaklarck commentedon Jul 7, 2018
This feature has now been implemented but documentation in the User Guide is still missing.
aaltat commentedon Jul 8, 2018
I would prefer
@over@{}but I don't feel strongly about the matter.pekkaklarck commentedon Jul 8, 2018
I kind of like
@better than@{}as well, but when used with other arguments@looks a bit weird. For example, the example above with@{} ${named}looks somehow better to me than@ ${named}. A problem with the latter is that Robot syntax highlighter here on GitHub doesn't recognize@as an argument and, for example, PyCharm works the same. These can be fixed eventually, but@{}working out-of-the box is nice.Libdoc: Support named-only args.
Add @Brian-Williams to AUTHORS.txt