Is there a way to list through subclass value? I'd like 'by' variable to be the first one and sort entire list by .number subclass.
class Abcd:
def __init__(self, name, number):
self.name = name
self.number = number
ax = Abcd("a", 20)
by = Abcd("b", 1)
lst = [ax, by]
print lst[0]
list.sort(lst)
print lst[0]