[ python-Bugs-839159 ] interators broken for weak dicts

SourceForge.net noreply at sourceforge.net
Mon Nov 10 06:32:12 EST 2003


Bugs item #839159, was opened at 2003-11-10 11:32
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=839159&group_id=5470

Category: Python Library
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Jim Fulton (dcjim)
Assigned to: Nobody/Anonymous (nobody)
Summary: interators broken for weak dicts

Initial Comment:
You can't use iterators on wekref dicts because items
might be removed from the dictionaries while iterating
due to GC.

I've attached a script that illustrates the bug with
Python 2.3.2. It doesn't matter whether you use weak
key or weak value dicts.

If this can't be fixed, then the iteration methods should
either be removed or made to (lamely) create intermediate
lists to work around the problem.



----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=839159&group_id=5470



More information about the Python-bugs-list mailing list