From: Michael S. <mik...@ya...> - 2005-04-26 18:47:00
|
Am I correct in assuming the code below is the standard way of iterating over components? for component in self.components.itervalues(): do stuff The following seems more intuitive to me. for component in self.components: do stuff However, this causes a KeyError exception because __iter__ is not defined. Is it ambiguous as to what self.components should iterate over? If this makes sense, an option would be to alias __iter__ in WidgetDict (model.py) to UserDict.UserDict.itervalues. Michael Find local movie times and trailers on Yahoo! Movies. http://au.movies.yahoo.com |