Neal Becker wrote:

> I have a list of dictionaries.  They all have the same keys.  I want to
> find the set of keys where all the dictionaries have the same values.  
Suggestions?

>>> items = [
... {1:2, 2:2},
... {1:1, 2:2},
... ]
>>> first = items[0].items()
>>> [key for key, value in first if all(item[key] == value for item in 
items)]
[2]


-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to