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
Items are not converted when using generics like list[int] and passing object, not string #4705
We added support for converting items with generics like list[int] and dict[str, int] in RF 6.0 (#4433). There unfortunately is a bug that it only works when passing values as string literals, not as actual object. For example, using this example from our Slack:
This was implemented so that all nested values are always converted and the top level object is recreated. That has a possible problem, that the actual argument passed to the keyword isn't the same instance that was used and mutating the value thus has no effect. Another problem is that if nested items already have a correct type, conversion can take some time and memory at least with bigger objects. It might be better to change the implementation so that if nested item types are as expected, no conversion is done. That's just somewhat more complicated and would probably benefit from a little refactoring to avoid duplication.
Activity
pekkaklarck commentedon Mar 30, 2023
This was implemented so that all nested values are always converted and the top level object is recreated. That has a possible problem, that the actual argument passed to the keyword isn't the same instance that was used and mutating the value thus has no effect. Another problem is that if nested items already have a correct type, conversion can take some time and memory at least with bigger objects. It might be better to change the implementation so that if nested item types are as expected, no conversion is done. That's just somewhat more complicated and would probably benefit from a little refactoring to avoid duplication.