I have a list of dictionaries, and want to add a key for each element of this list. I tried:
result = [ item.update({\"elem\":\"value\"}) for item in mylist
Either do not use a list comprehension, or return a new dict based on the original dict plus the new key:
[dict(list(item.items()) + [("elem", "value")]) for item in mylist]