I\'m trying to get a list of all keys in a list of dictionaries in order to fill out the fieldnames argument for csv.DictWriter.
previously, I had something like thi
>>> lis=[ {"name": "Tom", "age": 10}, {"name": "Mark", "age": 5, "height":4}, {"name": "Pam", "age": 7, "weight":90} ] >>> {z for y in (x.keys() for x in lis) for z in y} set(['age', 'name', 'weight', 'height'])