[Python-bugs-list] [ python-Bugs-448153 ] Dictionary iterators break old code

noreply@sourceforge.net noreply@sourceforge.net
Sun, 05 Aug 2001 06:27:11 -0700


Bugs item #448153, was opened at 2001-08-05 06:27
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=448153&group_id=5470

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Martin v. Löwis (loewis)
Assigned to: Nobody/Anonymous (nobody)
Summary: Dictionary iterators break old code

Initial Comment:
With the introduction of dictionary iterators, 
iteration over UserDict specializations may silently 
break existing code. The attached code is a 
simplification of the xml.dom.NamedNodeMap class, 
which provides iteration over the values using a 
well-defined order, which is implemented in 
__getitem__. In Python 2.2a1, __getitem__ is not 
called anymore, thus the code breaks.


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

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