> > Raymond then > translated > > > > for x in [1,2,3]: > > > > to > > > > for x in frozenset([1,2,3]):
That's not right. for-statements are not touched. > I may be missing something here (didn't follow the whole thread) but > those two are not functionally equal. > The docstring on frozenset sais "Build an immutable unordered collection." > So there's no guarantee that the elements will return from the > frozenset iterator in the order that you constructed the frozenset with, > right? Only contains expressions are translated: "if x in [1,2,3]" currently turns into: "if x in (1,2,3)" and I'm proposing that it go one step further: "if x in Seachset([1,2,3])" where Search set is a frozenset subtype that doesn't require x to be hashable. Also, the transformation would only happen when the contents of the search are all constants. Raymond _______________________________________________ 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