On 11/22/05, Ben Bush <[EMAIL PROTECTED]> wrote: > On 11/22/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > >>> ll = [[1,2],[2,1],[3,1],[1,4],[3,3],[1,4]] > > >>> ls = [frozenset(i) for i in ll] > > >>> ss = set(ls) > > >>> ss > > set([frozenset([1, 3]), frozenset([1, 2]), frozenset([1, 4]), > > frozenset([3])]) > > >>> [list(i) for i in ss] > > [[1, 3], [1, 2], [1, 4], [3]] > why this happens? > >>> from sets import * > >>> ll = [[1,2],[2,1],[3,1],[1,4],[3,3],[1,4]] > >>> ls = [frozenset(i) for i in ll] > Traceback (most recent call last): > File "<interactive input>", line 1, in ? > NameError: name 'frozenset' is not defined > I know that: Python 2.3 introduced the sets module. C implementations of set data types have now been added to the Python core as two new built-in types, set(iterable) and frozenset(iterable). But why it does not work in my machine? PythonWin 2.3.5 (#62, Feb 8 2005, 16:23:02) [MSC v.1200 32 bit (Intel)] on win32. Portions Copyright 1994-2001 Mark Hammond ([EMAIL PROTECTED]) - see 'Help/About PythonWin' for further copyright information. >>> from sets import * >>> dir(frozenset) Traceback (most recent call last): File "<interactive input>", line 1, in ? NameError: name 'frozenset' is not defined -- http://mail.python.org/mailman/listinfo/python-list