def by_index(l): assert type(l[0]) == int, l return l[0] def by_name(l): assert type(l[1]) == str, l return l[1] default_sort = by_name