-
Notifications
You must be signed in to change notification settings - Fork 35
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
csp.Struct needs to deepcopy its default values #69
Labels
type: bug
Concrete, reproducible bugs
Comments
robambalu
added a commit
that referenced
this issue
Mar 7, 2024
…se other fixes that popped up along the way: * Fix move semantics on python DialectGeneric impl * Fix deepcopy call when passing a tuple argument ( was only extracting first element ) * Fix extremely subtle deepcopy bug where partially created PyStruct was getting GC cleaned Signed-off-by: Ambalu, Robert <robert.ambalu@point72.com>
robambalu
added a commit
that referenced
this issue
Mar 7, 2024
fixes #69 - deepcopy struct default values on init. Also includes th…
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
If a csp.Struct type is defined with a mutable default ( ie dict ), then all instances of that type will share the same default. Mutate it in one, will mutate for all. This is similar to the age-old python mutable default argument problem, but we have the ability to fix it by deepcopying defaults instead of shallow copying
To Reproduce
The text was updated successfully, but these errors were encountered: