"""
datarow.py : implements a simple database record class
"""

class row:
    def __init__(self, cols, data):
        self.__dict__.update(zip(cols, data))
    def __repr__(self):
        return "user_record(id={0.id} name={0.name} email={0.email})".format(self)
    
if __name__ == "__main__": #simple self-test
    r1 = row(['id', 'name', 'email'],
            (1, "<NAME>", "<EMAIL>"))
    if r1.id != 1 or r1.name != "<NAME>" or r1.email != "<EMAIL>":
        print("TEST FAILED: id={0.id} name={0.name} email={0.email}".format(r1))

"""
datarow.py : implements a simple database record class
"""

class row:
    def __init__(self, cols, data):
        self.__dict__.update(zip(cols, data))
    def __repr__(self):
        return "user_record(id={0.id} name={0.name} email={0.email})".format(self)
    
if __name__ == "__main__": #simple self-test
    r1 = row(['id', 'name', 'email'],
            (1, "<NAME>", "<EMAIL>"))
    if r1.id != 1 or r1.name != "<NAME>" or r1.email != "<EMAIL>":
        print("TEST FAILED: id={0.id} name={0.name} email={0.email}".format(r1))

datarow.py : implements a simple database record class #simple self-test