On 6/16/05, Vibha Tripathi <[EMAIL PROTECTED]> wrote: > Hi Folks, > > I know sets have been implemented using dictionary but > I absolutely need to have a set of dictionaries...
While you can't have a set of mutable objects (even dictionaries :)), you can have a set of immutable snapshots of those objects: >>> d1 = {1: 'a', 2: 'b'} >>> d2 = {3: 'c'} >>> s = set([tuple(d1.iteritems()), tuple(d2.iteritems())]) >>> s set([((3, 'c'),), ((1, 'a'), (2, 'b'))]) >>> [dict(pairs) for pairs in s] [{3: 'c'}, {1: 'a', 2: 'b'}] - kv -- http://mail.python.org/mailman/listinfo/python-list