Hello,
While designing how dictionary variables should work, we actually
spent some time thinking how to handle cases where a dictionary
variable is not assigned alone:
&{dict1} &{dict2} = Keyword
${scalar} &{dict} = Keyword
&{dict} ${scalar} = Keyword
We could have decided to make them work, assuming the keyword returns
two items (technically any list-like object with two items), and items
matching dict variables would actually contain a mapping. The reason
we decided not to allow them was that similar cases with list
variables work totally differently:
${scalar} @{list} = Keyword
@{list} ${scalar} = Keyword
The above cases require the keyword to return one or more values
(technically any list-like object with one or more items). The item
matching the scalar variable will be assigned to it, but the remaining
values will be assigned to the list variable. Using a list variable
more than once fails:
@{list1} @{list2} = Keyword
In other words, we were worried that list and dict variables working
totally differently in this case would be confusing. We also thought
that there wouldn't be too much needs to assign dict variables other
than alone. Two emails about this subject on this list clearly shows
that at least some users would like to use the functionality we
decided not to support initially. Luckily changing the logic shouldn't
be too hard and the change shouldn't cause any backwards compatibility
problems. If the general consensus is that the behavior should be
changed, I'd be happy to review and merge pull requests.
Cheers,
.peke
> --
> You received this message because you are subscribed to the Google Groups
> "robotframework-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
robotframework-u...@googlegroups.com.
> To post to this group, send email to
robotframe...@googlegroups.com.
> Visit this group at
https://groups.google.com/group/robotframework-users.
>
> For more options, visit
https://groups.google.com/d/optout.
--
Agile Tester/Developer/Consultant ::
http://eliga.fi
Lead Developer of Robot Framework ::
http://robotframework.org