Closed HolQue closed 2 months ago
In the first line of the following code, implicitly I create a dictionary with a key (subKey1) inside that is of type dict. In the second line I overwrite this key with an integer value:
subKey1
dict
${testdict1.subKey1.subKey2} : 1, ${testdict1.subKey1} : 3
Outcome:
Error: 'Could not set variable 'testdict1['subKey1']['subKey2']' with value '1'! Reason: 'int' object does not support item assignment'!
It is astonishing that the error message indicates an error in the first line - because the first line (as stand-alone) works.
Why is it not possible to overwrite the value of a key anywhere in the middle of the key hierarchy?
The expectation is:
{'testdict1': {'subKey1': 3}}
I cross checked with pure Python. This works:
testdict3 = {"A" : {"B" : {"C" : 1}}} testdict3['A']['B'] = 2
Hello Holger,
I fixed the issue mentioned in this ticket and pushed the change to stabi branch.
Thank you, Son
Retest successful. Issue can be closed.
integrated in RobotFramework AIO 0.11.0
In the first line of the following code, implicitly I create a dictionary with a key (
subKey1
) inside that is of typedict
. In the second line I overwrite this key with an integer value:Outcome:
Error: 'Could not set variable 'testdict1['subKey1']['subKey2']' with value '1'! Reason: 'int' object does not support item assignment'!
It is astonishing that the error message indicates an error in the first line - because the first line (as stand-alone) works.
Why is it not possible to overwrite the value of a key anywhere in the middle of the key hierarchy?
The expectation is:
{'testdict1': {'subKey1': 3}}
I cross checked with pure Python. This works: