[issue839159] iterators broken for weak dicts

2010-07-23 Thread Mark Dickinson
Mark Dickinson added the comment: Agreed. -- resolution: -> duplicate status: open -> closed superseder: -> weak dict iterators are fragile because of unpredictable GC runs ___ Python tracker __

[issue839159] iterators broken for weak dicts

2010-07-23 Thread Virgil Dupras
Virgil Dupras added the comment: We might as well backport Antoine's patch rather than take this one (even if mine for 2.x already). It would be weird to have 2 wildly different patches to solve the same problem. Maybe close this ticket and flag issue7105 for backporting? -- ___

[issue839159] iterators broken for weak dicts

2010-07-23 Thread Mark Dickinson
Mark Dickinson added the comment: It's not yet fixed in 2.7 or 2.6. Updating versions. -- nosy: +mark.dickinson versions: +Python 2.6 -Python 3.1, Python 3.2 ___ Python tracker __

[issue839159] iterators broken for weak dicts

2010-07-23 Thread Virgil Dupras
Virgil Dupras added the comment: It looks like this issue has been fixed in issue7105 already. Can we close this ticket? -- ___ Python tracker ___

[issue839159] iterators broken for weak dicts

2010-07-14 Thread Mark Lawrence
Mark Lawrence added the comment: If this is to go forward the patch will need porting to 2.7, 3.1 and 3.2 -- nosy: +BreamoreBoy versions: +Python 2.7, Python 3.1, Python 3.2 -Python 2.5, Python 2.6 ___ Python tracker

[issue839159] iterators broken for weak dicts

2010-05-06 Thread Anthony Lenton
Anthony Lenton added the comment: Probably old news, but this also affects 2.5.4. -- nosy: +elachuni versions: +Python 2.5 ___ Python tracker ___ __

[issue839159] iterators broken for weak dicts

2010-05-03 Thread Tres Seaver
Tres Seaver added the comment: I can confirm that the patch applies with minimal fuzz to the release26-maint branches and the trunk, and that the added tests fail without the updated implementation in both cases. Furthermore, Jim's original demo script emits it error with my stock 2.6.5 Python,

[issue839159] iterators broken for weak dicts

2009-02-14 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Results without the patch: > ./python.exe weakref_bench.py > 0.804216861725 > > Results with the patch: > $ ./python.exe weakref_bench.py > 0.813000202179 Thanks for the numbers, I see my worries were unfounded. > About the test_weak_*_dict_flushed_dead_it

[issue839159] iterators broken for weak dicts

2009-02-14 Thread Virgil Dupras
Virgil Dupras added the comment: Oh, that's me again not correctly reading my own tests. It's the *_are_not_held_* tests that test that no reference is kept. I agree about the *_flushed_dead_items_* being an implementation detail. ___ Python tracker

[issue839159] iterators broken for weak dicts

2009-02-14 Thread Virgil Dupras
Virgil Dupras added the comment: About duplicated code and performance: When I look at the duplicated code, I don't see anything that remotely looks like a performance tweak. Just to make sure, I made a bench: #!/usr/bin/env python import sys sys.path.insert(0, 'Lib') import timeit import wea

[issue839159] iterators broken for weak dicts

2009-02-14 Thread Antoine Pitrou
Antoine Pitrou added the comment: Interesting patch. I think the intermediate assertEquals in test_weak_*_dict_flushed_dead_items_when_iters_go_out are just testing an implementation detail, only the final one should remain. Also, it is likely the "code duplication" you are talking about was th

[issue839159] iterators broken for weak dicts

2009-02-14 Thread Daniel Diniz
Daniel Diniz added the comment: Patch has tests, may need updating. -- nosy: +ajaksu2 stage: -> patch review ___ Python tracker ___ ___

[issue839159] iterators broken for weak dicts

2008-02-24 Thread Virgil Dupras
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 fir

[issue839159] iterators broken for weak dicts

2008-02-22 Thread A.M. Kuchling
Changes by A.M. Kuchling: -- title: interators broken for weak dicts -> iterators broken for weak dicts Tracker <[EMAIL PROTECTED]>