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
Unintentional hard reference assignment in Python version of OrderedDict.move_to_end #73305
Comments
The root.prev and first.prev assignments should use weak references rather than hard references. Spotted by Andra Bogildea. |
Makes sense. Any chance to create tests? |
I'm leaving this for Andra Bogildea to work through and comment on. Testing is likely to be awkward at best. It would involve white box implementation specific steps like accessing the name managed variables and rotating through the doubly linked list to verify that all the prev-links have the type, <class 'weakproxy'>. |
od_proxy2a.diff LGTM. |
od_proxy.diff and od_proxy2a.diff are the same. Did you meant soft_link = proxy(link) in od_proxy2a.diff? I believe Technique 1 (od_proxy.diff) is preferable, because it reuses the proxy object. Regarding automated tests, I agree with what’s been said. The usage of weak references is an internal detail (and name mangling makes it even more inconvenient). |
New changeset 19376765d7c3 by Raymond Hettinger in branch '3.5': |
New changeset cd811b867393 by Raymond Hettinger in branch '3.6': |
Nice work Andra. Thank you. |
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: