Greg Ewing wrote: > Brett Cannon wrote: >> Without a direct reason in terms of the language needing a >> standardization of an interface, perhaps we just don't need > > views. > > On the contrary, views are a very useful idea, *as a > design pattern*. What we *don't* need in Python, as far > as I can see, is any formalised protocols or interfaces > for views, because there's nothing that can be said about > them in general. > > Thinking that "having views" means "having a formally > defined interface for views" is a mindset that comes > from B&D languages like Java. It doesn't apply to > Python at all.
+lots All I think we're currently missing is an idea of 'what magic methods does an object need to provide in order to pretend to be a container, rather than just an iterable?' Change dict.keys/values/items to return views which implement that set of methods, and all should be good. Cheers, Nick. -- Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia --------------------------------------------------------------- http://www.boredomandlaziness.org _______________________________________________ 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