> > 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
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4