The documentation for Data::operator=() says that the value will be copied if the argument contains a basic type, and that if it's a list or a dict then this Data object will end up referring to the same one. Like a Python object, which is the intent.
However, the implementation will copy only a pointer if the source MessagePack type is STR, BIN, ARRAY, MAP or EXT, which means that strings, grids and Settings objects will also be referenced rather than copied. This needs to be documented more clearly I think. (It would be the same in Python, except that strings are immutable there.)
The documentation for
Data::operator=()
says that the value will be copied if the argument contains a basic type, and that if it's a list or a dict then this Data object will end up referring to the same one. Like a Python object, which is the intent.However, the implementation will copy only a pointer if the source MessagePack type is
STR
,BIN
,ARRAY
,MAP
orEXT
, which means that strings, grids and Settings objects will also be referenced rather than copied. This needs to be documented more clearly I think. (It would be the same in Python, except that strings are immutable there.)