names = []
for record in records:
names.append(record["name"])
to names = [record["name"] for record in records]
Now, I might say something if I saw this: import operator
names = list(map(operator.itemgetter("name"), records))
Seems a bit unidiomatic given that list comprehensions are in the language... but probably many disagree.