One way you could do it is by building a class to hold collections of people objects. One of the best ways to do this may be something like the following code:
class People:
def __init__(self):
self.members = {}
def add_person(self, person):
self.members[person.name] = person
def __getitem__(self, name):
return self.members[name]
class Person:
def __init__(self, name, id):
self.name = name
self.id = id
Now you should be able to fill up the People object like such:
# Add people to a People object
people = People()
people.add_person(Person('Bob', 1))
people.add_person(Person('Surly', 2))
# Get a person by their name
people['Bob'] # Returns instance that is People('Bob', 1)
Also just to let you know, I think your Person class' __init__ method has too many underscores in it. Hope this helps.
names andids to specific people. That would be the fastest approach, I think.