Le Mon, 28 Jan 2013 22:31:29 +1000, Nick Coghlan <ncogh...@gmail.com> a écrit : > > >> 6. Under "New collections" > >> > >> Why both lists and sets? > > > > Because pytz did it. But yes, you are right, an ordered set is a > > better solution. Baseing it on OrderedDict seems like a hack, > > though. I could implement a custom orderedset, of course. > > Sets themselves have an honourable history of just being a thin > wrapper around dictionaries with all the values set to None (although > they're not implemented that way any more). Whether you create an > actual OrderedSet class, or just expose the result of calling keys() > on an OrderedDict instance is just an implementation detail, though.
Why the complication? Just expose a regular set and let users call sorted() if that's what they want. I'm -1 on datetime shipping its own container subclass just for the sake of looking clever. Regards Antoine. _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com