[Python-Dev] Re: Prospective Peephole Transformation

Irmen de Jong irmen at xs4all.nl
Fri Feb 18 15:36:15 CET 2005


Skip Montanaro wrote:

> I suggested that since the standard library code is commonly used as an
> example of basic Python principles (that's probably not the right word), it
> should uphold that ideal tuple/list distinction.  Raymond then translated
> 
>     for x in [1,2,3]:
> 
> to
> 
>     for x in frozenset([1,2,3]):

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?


--Irmen


More information about the Python-Dev mailing list