Steven is right, however, there is a way: def new_record(slotlist): class R(object): __slots__ = slotlist return R()
record1 = new_record(["age", "name", "job"]) record1.age = 27 record1.name = 'Fred' record1.job = 'Plumber' record1.salary = 50000 -- http://mail.python.org/mailman/listinfo/python-list