Hi, If I have dict of dicts, say
dod = { "alice": { "lang": "python", "level": "expert" }, "bob": { "lang": "perl", "level": "noob" } } is there a canonical, or more pythonic, way of converting the outer key to a value to get a list of dicts, e.g lod = [ { "name": "alice", "lang": "python", "level": "expert" }, { "name": "bob", "lang": "perl", "level": "noob" } ] than just lod = [] for name in dod: d = dod[name] d["name"] = name lod.append(d) ? Cheers, Loris -- This signature is currently under construction. -- https://mail.python.org/mailman/listinfo/python-list