On 6/11/2011 9:32 PM, Andrew Berg wrote:
I'm pretty happy that I can copy variables and their value from one

You are copying names and their associations, but not the objects or thier values.

object's namespace to another object's namespace with the same variable
names automatically:

class simpleObject():
     pass

a = simpleObject()
b = simpleObject()

a.val1 = 1
a.val2 = 2
b.__dict__.update(a.__dict__)
a.val1 = 'a'

a.val1
'a'
a.val2
2
b.val1
1
b.val2
2


--
Terry Jan Reedy

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to