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

Missing __deepcopy__ implementation #1

Open
TobiSan5 opened this issue Jun 3, 2022 · 1 comment
Open

Missing __deepcopy__ implementation #1

TobiSan5 opened this issue Jun 3, 2022 · 1 comment

Comments

@TobiSan5
Copy link

TobiSan5 commented Jun 3, 2022

When trying a copy.deepcopy() on a Dotsi instance, there were a KeyError on deepcopy. Passing dict-structures around can easily lead to errors, if one doesn't make a deepcopy of the object. Thus, Dotsi would be better if it had it implementet.

@sumukhbarve
Copy link
Member

Hi @TobiSan5, thanks for creating this issue!

I agree with you. Deep-copying is useful, and __deepcopy__ should be added to DotsiDict. Will need to add the same to DotsiList too, as the two classes go hand-in-hand.

In the meantime, you could use the (currently undocumented) dotsi.deepCopy() function. It can deep-copy dict, DotsiDict, list, and DotsiList instances.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants