Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copying Data objects containing a grid does not copy the data #286

Open
LourensVeen opened this issue Jan 12, 2024 · 0 comments
Open

Copying Data objects containing a grid does not copy the data #286

LourensVeen opened this issue Jan 12, 2024 · 0 comments
Labels
documentation Improve the documentation

Comments

@LourensVeen
Copy link
Contributor

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.)

@LourensVeen LourensVeen added the documentation Improve the documentation label Jan 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improve the documentation
Projects
None yet
Development

No branches or pull requests

1 participant