-
-
Notifications
You must be signed in to change notification settings - Fork 30k
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
weakref copy module interaction #46370
Comments
The copy module will not properly copy/deepcopy weakrefs, it will bomb To replicate: import copy, weakref
class Test(object): pass
t = Test()
wr = weakref.ref(t)
wr_new = copy.copy(wr) |
Rick: In the future, please provide a context or unified diff ("diff |
Sorry about forgetting the -c arg! The patch is intended for It looks like Raymond Hettinger has made a similar-ish change recently |
Should a deepcopy of a weakref return the same weakref, or a weakref to |
Hmm, forget that question. If we deepcopy the weakref target, it will be |
Here is a patch providing proper copy and deepcopy support, including |
Updated patch so that copied weakdicts are decoupled (adding an item to |
Raymond, Guido, any opinion on this one? |
Committed in r72662, r72670. Thanks! |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: