[issue29119] Unintentional hard reference assignment in Python version of OrderedDict.move_to_end

2016-12-31 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Nice work Andra.  Thank you.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29119] Unintentional hard reference assignment in Python version of OrderedDict.move_to_end

2016-12-31 Thread Roundup Robot

Roundup Robot added the comment:

New changeset cd811b867393 by Raymond Hettinger in branch '3.6':
Issue #29119:  Merge in ACK from 3.5 branch
https://hg.python.org/cpython/rev/cd811b867393

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29119] Unintentional hard reference assignment in Python version of OrderedDict.move_to_end

2016-12-31 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 19376765d7c3 by Raymond Hettinger in branch '3.5':
Issue #29119: Fix weakref in OrderedDict.move_to_end(). Work by Andra Bogildea.
https://hg.python.org/cpython/rev/19376765d7c3

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29119] Unintentional hard reference assignment in Python version of OrderedDict.move_to_end

2016-12-31 Thread Andra Bogildea

Andra Bogildea added the comment:

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

--
nosy: +andrabogildea

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29119] Unintentional hard reference assignment in Python version of OrderedDict.move_to_end

2016-12-31 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

od_proxy2a.diff LGTM.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29119] Unintentional hard reference assignment in Python version of OrderedDict.move_to_end

2016-12-30 Thread Raymond Hettinger

Raymond Hettinger added the comment:

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

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29119] Unintentional hard reference assignment in Python version of OrderedDict.move_to_end

2016-12-30 Thread Raymond Hettinger

Changes by Raymond Hettinger :


Added file: http://bugs.python.org/file46099/od_proxy2a.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29119] Unintentional hard reference assignment in Python version of OrderedDict.move_to_end

2016-12-30 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Makes sense. Any chance to create tests?

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29119] Unintentional hard reference assignment in Python version of OrderedDict.move_to_end

2016-12-30 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
priority: normal -> low
Added file: http://bugs.python.org/file46098/od_proxy2.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29119] Unintentional hard reference assignment in Python version of OrderedDict.move_to_end

2016-12-30 Thread Raymond Hettinger

New submission from Raymond Hettinger:

The root.prev and first.prev assignments should use weak references rather than 
hard references.  Spotted by Andra Bogildea.

--
components: Library (Lib)
files: od_proxy.diff
keywords: patch
messages: 284367
nosy: rhettinger
priority: normal
severity: normal
status: open
title: Unintentional hard reference assignment in Python version of 
OrderedDict.move_to_end
type: resource usage
versions: Python 3.5, Python 3.6, Python 3.7
Added file: http://bugs.python.org/file46097/od_proxy.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com