people = [{'name': 'Tom', 'age': 10}, {'name': 'Mark', 'age': 5}]
name_indexer = dict((p['name'], i) for i, p in enumerate(people))
name_indexer.get('Tom', -1)
Python: Get index of dictionary item in list