Virgil Dupras hs...@hardcoded.net added the comment:
It looks like this issue has been fixed in issue7105 already. Can we close this
ticket?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue839159
Mark Dickinson dicki...@gmail.com 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 rep...@bugs.python.org
Virgil Dupras hs...@hardcoded.net 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?
Mark Dickinson dicki...@gmail.com added the comment:
Agreed.
--
resolution: - duplicate
status: open - closed
superseder: - weak dict iterators are fragile because of unpredictable GC runs
___
Python tracker rep...@bugs.python.org
Mark Lawrence breamore...@yahoo.co.uk 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
Anthony Lenton anthony.len...@canonical.com added the comment:
Probably old news, but this also affects 2.5.4.
--
nosy: +elachuni
versions: +Python 2.5
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue839159
Tres Seaver tsea...@agendaless.com 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
Daniel Diniz aja...@gmail.com added the comment:
Patch has tests, may need updating.
--
nosy: +ajaksu2
stage: - patch review
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue839159
___
Antoine Pitrou pit...@free.fr 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
Virgil Dupras hs...@hardcoded.net 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')
Virgil Dupras hs...@hardcoded.net 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.
___
Antoine Pitrou pit...@free.fr 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
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
Changes by A.M. Kuchling:
--
title: interators broken for weak dicts - iterators broken for weak dicts
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue839159
___
14 matches
Mail list logo