import dataClass as dc o1 = dc.exampleDataClass() o2 = dc.exampleDataClass() print "Data is object data member:" print "BEFORE:" print "o1.obj_var: ", o1.obj_var print "o2.obj_var:", o2.obj_var o1.obj_var = "new_object_data" print "AFTER:" print "o1.obj_var: ", o1.obj_var print "o2.obj_var:", o2.obj_var
import dataClass as dc o = dc.exampleDataClass(); print dir(o); del o.obj_var o.new_data = "some_data" o.f2 = lambda x: x * 3 print dir(o); print o.new_data print o.f2("M")
import dataClass as dc o1 = dc.exampleDataClass(); o2 = dc.exampleDataClass(); print "Data is object data member:" print "BEFORE:" print "o1.cls_var:", o1.cls_var print "o2.cls_var:", o2.cls_var dc.exampleDataClass.cls_var =\ "new_object_data" print "AFTER:" print "o1.cls_var: ", o1.cls_var print "o2.cls_var:", o2.cls_var
import dataClass as dc o = dc.exampleDataClass() print dir(o) del o.obj_var o.new_data = "some_data" o.f2 = lambda x: x * 3 print dir(o) print o.new_data print o.f2("M")