> On Wed, Apr 2, 2008 at 5:08 PM, Mike Klaas <[EMAIL PROTECTED]> wrote: >> ...and the majority of these cases would work fine with views (input >> to sorted(), etc). > > Suppose "the majority" here means 36 of the 46 cases.
What makes you suppose so. In the standard library of Python 2.5, I could not find a single case where using views would cause silent breakage: - the majority of uses is in for loops or list comprehensions. - of the remaining uses, the majority is with .sort(), which would cause an exception, to be rewritten as sorted(foo.items()) - of the then-remaining cases, the majority is immediately followed by an iteration, with no intermediate changes to the dictionary. - in some cases, the view is returned to the caller (i.e. outside of the standard library); whether this would break anything would depend on the application. In your code, how many (in absolute numbers) applications of .items() would break when .items() becomes a view? Regards, Martin _______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com