Vibha Tripathi wrote:
> Hi Folks,
> 
> I know sets have been implemented using dictionary but
> I absolutely need to have a set of dictionaries...any
> ideas how to do that?
> 
> Peace.
> Vibha
> 
> "Things are only impossible until they are not."
> 
> 
>               
> __________________________________ 
> Discover Yahoo! 
> Find restaurants, movies, travel and more fun for the weekend. Check it out! 
> http://discover.yahoo.com/weekend.html 
> 
This is too bad.  There is a problem even defining what you want.

Assume we have a DictSet type:

After:
      a = dict(a=1, b=2)
      b = dict(a=2, b=1)
      c = dict(b=2, a=1)
      ds = Dictset([a, b, c])
What is len(ds)?

After those lines and:
     c['a'] = 2
What is len(ds)?

After all the previous lines and:
     a['a'] = 2
     b['b'] = 2
What is len(ds)?

Making sets of mutable things is pretty useless.
You could make sets of tuple(sorted(adict.items()))
if the "adict"s don't have mutable values.

--Scott David Daniels
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to