I would say, really. Your Users class seems to be just a list of users, so I would just make it a list, not an entire class. Here is what I will do:
class User(object): def __init__(self, user_id=None, email=None): self.user_id, self.email = user_id, email users = [] users.append(User(user_id = 1, email = ' bob@example.com ')) for u in users: print u.email
If you want Users be a class for some other reason, you could inherit it from list or (if not), you can add them to the definition:
class Users(object):
So you can just say:
users = Users() ... for u in users: print u.email
Chris lutz
source share