[Python-Dev] Weak dict iterators are fragile (original) (raw)
Antoine Pitrou solipsis at pitrou.net
Sun Oct 11 18:26:21 CEST 2009
- Previous message: [Python-Dev] Weak dict iterators are fragile
- Next message: [Python-Dev] Backport new float repr to Python 2.7?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Antoine Pitrou <solipsis pitrou.net> writes:
1. Add the safe methods listkeys(), listitems(), listvalues() which would behave as the keys(), etc. methods from 2.x 2. Make it so that keys(), items(), values() atomically build a list of items internally, which makes them more costly for large weak dicts, but robust.
And a third one (a bit more complicated implementation-wise):
- Delay weak dict removals until any iteration has finished.
Regards
Antoine.
- Previous message: [Python-Dev] Weak dict iterators are fragile
- Next message: [Python-Dev] Backport new float repr to Python 2.7?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]