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
Simpler syntax to create lists, dicts, and other collections as arguments to keywords #4478
This is pretty convenient, but needing to use Python syntax is a bit ugly in general and especially annoying when using embedded arguments that are supposed to enhance readability:
Select animals ['cat', 'dog'] from list
I propose we enhance argument conversion so that we support also the following syntax:
Accept List list, items, here
Accept Dict key=value, another=item
The high level semantics would be as follows:
Separator between items is a comma and a space. This allows using commas in values like first, second,with,commas, third. Having a comma followed by a space in the value wouldn't be possible.
We could allow using a semicolon and a space as an alternative separator. In that case we'd use the separator that's encountered first. This would allow usages like first; second, with, commas followed by spaces; third.
With dictionaries the separator between key and value is =. This is the syntax we use also when creating &{dict} variables.
Because this would be handled by type convertors, variables would have been resolved already earlier. That means that something like ${1}, ${2} wouldn't create a list of integers. See the above point for alternatives.
Also escapes are handled before type conversion. That makes it impossible to use something like first, second\,with\,commas for escaping commas in values.
This enhancement would ease using collections a lot especially if #4433 and #4477 are implemented. If we agree above semantics are fine, implementation would also be pretty easy. I thus add this to RF 5.1 scope even though the release is already late.
After the proposed change should this work and would it be more readable than the old one? I would personally expect some sort of separator around the list items.
Based on the discussion on Slack, it seems this isn't considered that important and there are concerns about the syntax. Let's descope this from RF 5.1 and think about this again later.
Activity
xylix commentedon Sep 26, 2022
Select animals cat, dog from listAfter the proposed change should this work and would it be more readable than the old one? I would personally expect some sort of separator around the list items.
pekkaklarck commentedon Sep 27, 2022
Select animals cat, dog from listisn't great, but it's certainly better for non-programmers thanSelect animals ['cat', 'dog'] from list.pekkaklarck commentedon Sep 27, 2022
Based on the discussion on Slack, it seems this isn't considered that important and there are concerns about the syntax. Let's descope this from RF 5.1 and think about this again later.