Virgil Dupras added the comment: I made a patch to fix the problem. The cleaning up of they weakref keys or values will be held until all references to iterators created by the weakdict are dead.
I also couldn't resist removing code duplication of code in items(), keys() and values(). At first, I couldn't understand why this whole remove(), _remove() and selfref() mechanism was in place. I had removed them and replaced them with methods, and the tests still passed. Then I realized it was to make sure keys and values didn't prevent the weak dicts from being freed. I added tests for this. ---------- keywords: +patch nosy: +vdupras type: -> behavior versions: +Python 2.6 Added file: http://bugs.python.org/file9537/weakref_dict_iter.diff ____________________________________ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue839159> ____________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com