class Mock(object):
    age_index = defaultdict(list)

def __init__(self, name, age):
    self.name = name
self.age = age
Mock.age_index[age].append(self)

@classmethod
def find_by_age(cls, age):
    return Mock.age_index[age]
Find object by its member inside a List in python