Have a list
of dict
objects where 50% will have a key name
and 50% will have a key full_name
and I'd like it sorted alphabetically based on either key.
Some sort function like:
if 'name' in a:
a_name = a['name']
elif 'full_name' in a:
a_name = a['full_name']
# repeat with a b in the compare, sort based on value
Is there a more efficient way here?