I want to sort a list of named tuples without having to remember the index of the fieldname. My solution seems rather awkward and was hoping someone would have a more elegan
This might be a bit too 'magical' for some, but I'm partial to:
# sort list by name print(sorted(seq, key=Person.name.fget))